Skip to content

Commit 78ce179

Browse files
authored
Fix quality curation when other labels are given by user (#260)
1 parent be4d6cc commit 78ce179

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

spikeinterface_gui/backend_panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ def set_external_curation(self, curation_data):
431431

432432
curation_view = self.views["curation"]
433433
self.controller.set_curation_data(curation_data)
434-
self.controller.current_curation_saved = True
435434
curation_view.notify_manual_curation_updated()
435+
self.controller.current_curation_saved = True
436436
curation_view.refresh()
437437

438438
# we also need to refresh the unit list view to update the unit visibility according to the new curation

spikeinterface_gui/controller.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ def set_curation_data(self, curation_data):
900900
new_curation_data["label_definitions"] = default_label_definitions.copy()
901901

902902
# validate the curation data
903-
model = CurationModel(**new_curation_data)
903+
model = Curation(**new_curation_data)
904904
self.curation_data = model.model_dump()
905905

906906
def save_curation_in_analyzer(self):
@@ -1117,11 +1117,13 @@ def set_label_to_unit(self, unit_id, category, label):
11171117
if label is None:
11181118
self.remove_category_from_unit(unit_id, category)
11191119
return
1120+
1121+
label_types = self.curation_data['label_definitions'].keys()
11201122

11211123
ix = self.find_unit_in_manual_labels(unit_id)
11221124
if ix is not None:
11231125
lbl = self.curation_data["manual_labels"][ix]
1124-
if "labels" in lbl and category in lbl["labels"]:
1126+
if "labels" in lbl and category in label_types:
11251127
# v2 format
11261128
lbl["labels"][category] = [label]
11271129
elif category in lbl:

0 commit comments

Comments
 (0)