Skip to content

Commit faa1a08

Browse files
committed
Clean up status text
1 parent 922be02 commit faa1a08

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

icat/anchorlist.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1104,11 +1104,11 @@ def featurize(
11041104
self.table.processing = True
11051105
features = []
11061106
for anchor in self.anchors:
1107-
self.fire_on_status_event(f"Computing features for {anchor.anchor_name}...")
1107+
# self.fire_on_status_event(f"Computing features for {anchor.anchor_name}...")
11081108
self.table._set_anchor_processing(anchor.name, True)
11091109
data[f"_{anchor.anchor_name}"] = anchor.featurize(data) * anchor.weight
11101110
features.append(f"_{anchor.anchor_name}")
1111-
self.fire_on_status_event(None)
1111+
# self.fire_on_status_event(None)
11121112
self.table._set_anchor_processing(anchor.name, False)
11131113
if normalize:
11141114
if reference_data is not None:

icat/model.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def _on_selected_points_change(self, selected_ids: list[str]):
205205
def _train_model(self):
206206
"""Fits the data to the current training dataset, note that this function
207207
assumes the data has already been featurized."""
208-
self.fire_on_status_event(None) # clear/refresh status label
208+
self.fire_on_status_event(None) # reset/clear status
209209

210210
if not self.is_seeded():
211211
# we short circuit training the model here, but we do still want to show
@@ -352,6 +352,7 @@ def fit(self):
352352
# self.norm_reference = self.featurize(self.data.active_data, normalize=False)[
353353
# features
354354
# ].copy()
355+
self.fire_on_status_event("Computing features...")
355356
self.data.active_data = self.featurize(self.data.active_data, normalize=False)
356357
if self.training_data is not None:
357358
self.training_data = self.featurize(
@@ -364,6 +365,7 @@ def fit(self):
364365
# self.data.active_data.loc[:, features] = self.data.active_data[features].apply(
365366
# AnchorList._l1_col_normalize, axis=0
366367
# )
368+
self.fire_on_status_event(None)
367369

368370
self._train_model()
369371

icat/view.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def _handle_status_event(self, status_text: str, source: str):
9494
self.status_label.children = f"Status: {status_text}"
9595
else:
9696
if self.model.is_seeded():
97-
self.status_label.children = "Status: Ready!"
97+
self.status_label.children = "Status: Model ready"
9898
else:
9999
# TODO: replicating logic from model.is_seeded, better way to handle?
100100
labeled_df = None
@@ -114,9 +114,9 @@ def _handle_status_event(self, status_text: str, source: str):
114114

115115
if labeled_df is not None:
116116
if len(labeled_df[labeled_df[self.model.data.label_col] == 0]) == 0:
117-
label_str += " Label at least one more point uninteresting."
117+
label_str += " Need at least one point labeled 'uninteresting'."
118118
if len(labeled_df[labeled_df[self.model.data.label_col] == 1]) == 0:
119-
label_str += " Label at least one more point interesting."
119+
label_str += " Need at least one point labeled 'interesting'."
120120
self.status_label.children = label_str
121121

122122
def _handle_data_sample_changed(self, new_sample_indices: list[int]):

0 commit comments

Comments
 (0)