From 3615ce6bcac2b575d830742666db02d7e0b4c455 Mon Sep 17 00:00:00 2001 From: rly Date: Fri, 31 May 2024 23:01:43 -0700 Subject: [PATCH] Remove references to tetrodeseries --- .../ndx_extracellular_channels/__init__.py | 6 --- .../widgets/README.md | 6 --- .../widgets/__init__.py | 10 ---- .../widgets/tetrode_series_widget.py | 49 ------------------- 4 files changed, 71 deletions(-) delete mode 100644 src/pynwb/ndx_extracellular_channels/widgets/README.md delete mode 100644 src/pynwb/ndx_extracellular_channels/widgets/__init__.py delete mode 100644 src/pynwb/ndx_extracellular_channels/widgets/tetrode_series_widget.py diff --git a/src/pynwb/ndx_extracellular_channels/__init__.py b/src/pynwb/ndx_extracellular_channels/__init__.py index 54d0071..0bf20fa 100644 --- a/src/pynwb/ndx_extracellular_channels/__init__.py +++ b/src/pynwb/ndx_extracellular_channels/__init__.py @@ -25,11 +25,5 @@ ChannelsTable = get_class("ChannelsTable", "ndx-extracellular-channels") ExtracellularSeries = get_class("ExtracellularSeries", "ndx-extracellular-channels") -# NOTE: `widgets/tetrode_series_widget.py` adds a "widget" -# attribute to the TetrodeSeries class. This attribute is used by NWBWidgets. -# Delete the `widgets` subpackage or the `tetrode_series_widget.py` module -# if you do not want to define a custom widget for your extension neurodata -# type. - # Remove these functions from the package del load_namespaces, get_class diff --git a/src/pynwb/ndx_extracellular_channels/widgets/README.md b/src/pynwb/ndx_extracellular_channels/widgets/README.md deleted file mode 100644 index cf51d8e..0000000 --- a/src/pynwb/ndx_extracellular_channels/widgets/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Add widgets that define custom visualizations for your extension, so that -the visualizations can be displayed with -[nwbwidgets](https://github.com/NeurodataWithoutBorders/nwbwidgets). - -You will also need to update the `vis_spec` dictionary in `__init__.py` so that -nwbwidgets can find your custom visualizations. \ No newline at end of file diff --git a/src/pynwb/ndx_extracellular_channels/widgets/__init__.py b/src/pynwb/ndx_extracellular_channels/widgets/__init__.py deleted file mode 100644 index bfb1558..0000000 --- a/src/pynwb/ndx_extracellular_channels/widgets/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# This module is imported by nwbwidgets when -# nwbwidgets.load_extension_widgets_into_spec([ndx_extracellular_channels]) -# is called. Otherwise, the module is not imported unless explicitly imported. - -from .tetrode_series_widget import TetrodeSeriesWidget -from .. import TetrodeSeries - -vis_spec = { - TetrodeSeries: TetrodeSeriesWidget, -} diff --git a/src/pynwb/ndx_extracellular_channels/widgets/tetrode_series_widget.py b/src/pynwb/ndx_extracellular_channels/widgets/tetrode_series_widget.py deleted file mode 100644 index f2d787d..0000000 --- a/src/pynwb/ndx_extracellular_channels/widgets/tetrode_series_widget.py +++ /dev/null @@ -1,49 +0,0 @@ -# If NWBWidgets is installed, create a custom widget for the TetrodeSeries -# neurodata type. -# -# You will also need to update the `vis_spec` dictionary in `__init__.py` so -# that nwbwidgets can find your custom visualizations. -# -# Example usage: -# from nwbwidgets import nwb2widget, load_extension_widgets_into_spec -# load_extension_widgets_into_spec([ndx_extracellular_channels]) -# nwb2widget(nwbfile) - -try: - from nwbwidgets.ecephys import ElectricalSeriesWidget - from ipywidgets import widgets - - from .. import TetrodeSeries - - # TODO define your own custom widget for your extension neurodata type - # using TetrodeSeriesWidget as an example. - class TetrodeSeriesWidget(ElectricalSeriesWidget): # this is an HBox - """Show the trode_id above the ElectricalSeries widget""" - - def __init__(self, tetrode_series: TetrodeSeries, **kwargs): - super().__init__(electrical_series=tetrode_series, **kwargs) - vbox = widgets.VBox( - children=[ - self._create_trode_id_box(tetrode_series), - widgets.HBox(children=list(self.children)), - ] - ) - self.children = [vbox] - - def _create_trode_id_box(self, tetrode_series: TetrodeSeries): - field_lay = widgets.Layout( - max_height="40px", - max_width="600px", - min_height="30px", - min_width="130px", - ) - key = widgets.Label("trode_id:", layout=field_lay) - val = widgets.Label(str(tetrode_series.trode_id), layout=field_lay) - return widgets.HBox(children=[key, val]) - - # add the widget class to the TetrodeSeries class - TetrodeSeries.widget = TetrodeSeriesWidget - -except ImportError: - print("NWBWidgets is not installed, so we cannot create a new widget.") # noqa: T201 - print("Run `pip install nwbwidgets` to install NWBWidgets.") # noqa: T201