From 7c734ce456cb473c85f75c0faf52542bc1528710 Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Mon, 30 Mar 2026 17:57:25 +0100 Subject: [PATCH 1/3] 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/3] 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 d51a8576ff9a4651137c7c634175733329c6fdbd Mon Sep 17 00:00:00 2001 From: chrishalcrow Date: Wed, 15 Apr 2026 16:40:04 +0100 Subject: [PATCH 3/3] remove notify_unit_visibility_changed from unitlistview --- spikeinterface_gui/unitlistview.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spikeinterface_gui/unitlistview.py b/spikeinterface_gui/unitlistview.py index 5e18c8f..c501dc8 100644 --- a/spikeinterface_gui/unitlistview.py +++ b/spikeinterface_gui/unitlistview.py @@ -32,12 +32,12 @@ def update_manual_labels(self): elif self.backend == 'panel': self._panel_update_labels() - def notify_unit_visibility_changed(self): + def notify_unit_and_channel_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() + self.notify_unit_visibility_changed() ## Qt ## def _qt_make_layout(self): @@ -337,7 +337,7 @@ def _qt_on_item_changed(self, item): self.controller.set_unit_visibility(unit_id, is_visible) updated_visibile_units = self.controller.get_visible_unit_ids() if set(current_visible_units) != set(updated_visibile_units): - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() elif col in self.label_columns: @@ -356,7 +356,7 @@ def _qt_on_double_clicked(self, row, col): self.controller.set_visible_unit_ids([unit_id]) updated_visibile_units = self.controller.get_visible_unit_ids() if set(current_visible_units) != set(updated_visibile_units): - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() self._qt_refresh_visibility_items() def _qt_on_open_context_menu(self): @@ -383,7 +383,7 @@ def _qt_on_visible_shortcut(self): self.controller.set_visible_unit_ids(self.get_selected_unit_ids()) updated_visibile_units = self.controller.get_visible_unit_ids() if set(current_visible_units) != set(updated_visibile_units): - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() self._qt_refresh_visibility_items() for row in rows: @@ -414,7 +414,7 @@ def _qt_on_only_next_shortcut(self): self.controller.set_visible_unit_ids([unit_id]) updated_visibile_units = self.controller.get_visible_unit_ids() if set(current_visible_units) != set(updated_visibile_units): - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() self._qt_refresh_visibility_items() self.table.clearSelection() self.table.selectRow(new_row) @@ -680,7 +680,7 @@ def _panel_on_visible_checkbox_toggled(self, row): # update the visible column self.table.value.loc[self.controller.unit_ids, "visible"] = self.controller.get_units_visibility_mask() - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() self.refresh() def _panel_on_unit_visibility_changed(self): @@ -754,7 +754,7 @@ def _panel_on_only_selection(self): df = self.table.value df.loc[self.controller.unit_ids, "visible"] = self.controller.get_units_visibility_mask() self.table.value = df - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() def _panel_get_selected_unit_ids(self): unit_ids = self.table.value.index.values @@ -809,7 +809,7 @@ def _panel_handle_shortcut(self, event): self.controller.set_visible_unit_ids(selected_unit_ids) updated_visibile_units = self.controller.get_visible_unit_ids() if set(current_visibile_units) != set(updated_visibile_units): - self.notify_unit_visibility_changed() + self.notify_unit_and_channel_visibility_changed() self.refresh() elif event.data == "clear": for unit_id in selected_unit_ids: