From 4e0d7ed8105c4c4603721f0899ece31572d0bcf8 Mon Sep 17 00:00:00 2001 From: Gaelle Date: Fri, 31 May 2024 12:38:31 +0100 Subject: [PATCH 1/3] picks --- src/spikeinterface/widgets/base.py | 2 ++ src/spikeinterface/widgets/traces.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/spikeinterface/widgets/base.py b/src/spikeinterface/widgets/base.py index b94167d2b7..9db65b2fbe 100644 --- a/src/spikeinterface/widgets/base.py +++ b/src/spikeinterface/widgets/base.py @@ -47,6 +47,7 @@ def set_default_plotter_backend(backend): }, "ephyviewer": {}, "spikeinterface_gui": {}, + "viewephys": {} } default_backend_kwargs = { @@ -55,6 +56,7 @@ def set_default_plotter_backend(backend): "ipywidgets": {"width_cm": 25, "height_cm": 10, "display": True, "controllers": None}, "ephyviewer": {}, "spikeinterface_gui": {}, + "viewephys": {} } diff --git a/src/spikeinterface/widgets/traces.py b/src/spikeinterface/widgets/traces.py index d5bfe8caa4..6a135fa921 100644 --- a/src/spikeinterface/widgets/traces.py +++ b/src/spikeinterface/widgets/traces.py @@ -661,6 +661,20 @@ def plot_ephyviewer(self, data_plot, **backend_kwargs): win.show() app.exec() + def plot_viewephys(self, data_plot, **backend_kwargs): + from viewephys.gui import SpikeInterfaceViewer + import easyqc.qt + from ..preprocessing import depth_order + + dp = to_attr(data_plot) + assert len(dp.recordings) == 1 + + recording = list(dp.recordings.values())[0] + recording = depth_order(recording) + app = easyqc.qt.create_app() + siv = SpikeInterfaceViewer(recording) # TODO dict of recordings + self.siv = siv + app.exec() def _get_trace_list(recordings, channel_ids, time_range, segment_index, return_scaled=False, times=None): # function also used in ipywidgets plotter From 31b60a8b27cdffcbfb08e1afe38fbd630c2b82a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 14:16:36 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/widgets/base.py | 4 ++-- src/spikeinterface/widgets/traces.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spikeinterface/widgets/base.py b/src/spikeinterface/widgets/base.py index 9db65b2fbe..26106c2457 100644 --- a/src/spikeinterface/widgets/base.py +++ b/src/spikeinterface/widgets/base.py @@ -47,7 +47,7 @@ def set_default_plotter_backend(backend): }, "ephyviewer": {}, "spikeinterface_gui": {}, - "viewephys": {} + "viewephys": {}, } default_backend_kwargs = { @@ -56,7 +56,7 @@ def set_default_plotter_backend(backend): "ipywidgets": {"width_cm": 25, "height_cm": 10, "display": True, "controllers": None}, "ephyviewer": {}, "spikeinterface_gui": {}, - "viewephys": {} + "viewephys": {}, } diff --git a/src/spikeinterface/widgets/traces.py b/src/spikeinterface/widgets/traces.py index 6a135fa921..ee4c0e4712 100644 --- a/src/spikeinterface/widgets/traces.py +++ b/src/spikeinterface/widgets/traces.py @@ -676,6 +676,7 @@ def plot_viewephys(self, data_plot, **backend_kwargs): self.siv = siv app.exec() + def _get_trace_list(recordings, channel_ids, time_range, segment_index, return_scaled=False, times=None): # function also used in ipywidgets plotter k0 = list(recordings.keys())[0] From 3a1fbf8895f693d0982d4bc02f8448125db530e6 Mon Sep 17 00:00:00 2001 From: Gaelle Date: Fri, 31 May 2024 15:22:20 +0100 Subject: [PATCH 3/3] add viewephys to test to be skipped --- src/spikeinterface/widgets/tests/test_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/widgets/tests/test_widgets.py b/src/spikeinterface/widgets/tests/test_widgets.py index 5366fb864f..a2a167b1d8 100644 --- a/src/spikeinterface/widgets/tests/test_widgets.py +++ b/src/spikeinterface/widgets/tests/test_widgets.py @@ -95,7 +95,7 @@ def setUpClass(cls): cls.sorting_analyzer_sparse.compute("random_spikes") cls.sorting_analyzer_sparse.compute(extensions_to_compute, **job_kwargs) - cls.skip_backends = ["ipywidgets", "ephyviewer", "spikeinterface_gui"] + cls.skip_backends = ["ipywidgets", "ephyviewer", "spikeinterface_gui", "viewephys"] # cls.skip_backends = ["ipywidgets", "ephyviewer", "sortingview"] if ON_GITHUB and not KACHERY_CLOUD_SET: