From 7c734ce456cb473c85f75c0faf52542bc1528710 Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Mon, 30 Mar 2026 17:57:25 +0100 Subject: [PATCH 1/4] update channel visibility on unit change from unitview --- spikeinterface_gui/unitlistview.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spikeinterface_gui/unitlistview.py b/spikeinterface_gui/unitlistview.py index bae636b..405e159 100644 --- a/spikeinterface_gui/unitlistview.py +++ b/spikeinterface_gui/unitlistview.py @@ -32,6 +32,13 @@ def update_manual_labels(self): elif self.backend == 'panel': self._panel_update_labels() + def notify_unit_visibility_changed(self): + selected_units = self.controller.get_visible_unit_ids() + visible_channel_inds = self.controller.get_common_sparse_channels(selected_units) + self.controller.set_channel_visibility(visible_channel_inds) + self.notify_channel_visibility_changed() + super().notify_unit_visibility_changed() + ## Qt ## def _qt_make_layout(self): From 0ebdd27b383323752420e5835fa9251fdc4a560a Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Mon, 30 Mar 2026 17:58:23 +0100 Subject: [PATCH 2/4] Revert "update channel visibility on unit change from unitview" This reverts commit 7c734ce456cb473c85f75c0faf52542bc1528710. --- spikeinterface_gui/unitlistview.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/spikeinterface_gui/unitlistview.py b/spikeinterface_gui/unitlistview.py index 405e159..bae636b 100644 --- a/spikeinterface_gui/unitlistview.py +++ b/spikeinterface_gui/unitlistview.py @@ -32,13 +32,6 @@ def update_manual_labels(self): elif self.backend == 'panel': self._panel_update_labels() - def notify_unit_visibility_changed(self): - selected_units = self.controller.get_visible_unit_ids() - visible_channel_inds = self.controller.get_common_sparse_channels(selected_units) - self.controller.set_channel_visibility(visible_channel_inds) - self.notify_channel_visibility_changed() - super().notify_unit_visibility_changed() - ## Qt ## def _qt_make_layout(self): From 811b05b3c017284011e2510a9442a6d1410fb641 Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Tue, 31 Mar 2026 18:00:13 +0100 Subject: [PATCH 3/4] change label check for v2 curation --- spikeinterface_gui/controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spikeinterface_gui/controller.py b/spikeinterface_gui/controller.py index 105783f..353b292 100644 --- a/spikeinterface_gui/controller.py +++ b/spikeinterface_gui/controller.py @@ -1117,11 +1117,13 @@ def set_label_to_unit(self, unit_id, category, label): if label is None: self.remove_category_from_unit(unit_id, category) return + + label_types = self.curation_data['label_definitions'].keys() ix = self.find_unit_in_manual_labels(unit_id) if ix is not None: lbl = self.curation_data["manual_labels"][ix] - if "labels" in lbl and category in lbl["labels"]: + if "labels" in lbl and category in label_types: # v2 format lbl["labels"][category] = [label] elif category in lbl: From c9052e12db700f51a7af9c3fdb3384e0d7b5e638 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 1 Apr 2026 10:20:27 +0200 Subject: [PATCH 4/4] a couple of additional fixes --- spikeinterface_gui/backend_panel.py | 2 +- spikeinterface_gui/controller.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spikeinterface_gui/backend_panel.py b/spikeinterface_gui/backend_panel.py index 7c4da4b..19c8a2b 100644 --- a/spikeinterface_gui/backend_panel.py +++ b/spikeinterface_gui/backend_panel.py @@ -431,8 +431,8 @@ def set_external_curation(self, curation_data): curation_view = self.views["curation"] self.controller.set_curation_data(curation_data) - self.controller.current_curation_saved = True curation_view.notify_manual_curation_updated() + self.controller.current_curation_saved = True curation_view.refresh() # we also need to refresh the unit list view to update the unit visibility according to the new curation diff --git a/spikeinterface_gui/controller.py b/spikeinterface_gui/controller.py index 353b292..3ddea2d 100644 --- a/spikeinterface_gui/controller.py +++ b/spikeinterface_gui/controller.py @@ -900,7 +900,7 @@ def set_curation_data(self, curation_data): new_curation_data["label_definitions"] = default_label_definitions.copy() # validate the curation data - model = CurationModel(**new_curation_data) + model = Curation(**new_curation_data) self.curation_data = model.model_dump() def save_curation_in_analyzer(self):