Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to render tabs in neuronal units section. #242

Open
rcpeene opened this issue Dec 8, 2022 · 3 comments
Open

Fails to render tabs in neuronal units section. #242

rcpeene opened this issue Dec 8, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@rcpeene
Copy link

rcpeene commented Dec 8, 2022

I am attempting to inspect the nwb file named sub-699733573_ses-715093703.nwb here in Dandiset:000021. When clicking on the Units section, and clicking on any of the tabs Raster Grid , Tuning Curve, or Combined, this error shows up.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\ipywidgets\widgets\widget.py:756, in Widget._handle_msg(self, msg)
    754         if 'buffer_paths' in data:
    755             _put_buffers(state, data['buffer_paths'], msg['buffers'])
--> 756         self.set_state(state)
    758 # Handle a state request.
    759 elif method == 'request_state':

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\ipywidgets\widgets\widget.py:625, in Widget.set_state(self, sync_data)
    622 if name in self.keys:
    623     from_json = self.trait_metadata(name, 'from_json',
    624                                     self._trait_from_json)
--> 625     self.set_trait(name, from_json(sync_data[name], self))

File ~\AppData\Local\Programs\Python\Python39\lib\contextlib.py:126, in _GeneratorContextManager.__exit__(self, typ, value, traceback)
    124 if typ is None:
    125     try:
--> 126         next(self.gen)
    127     except StopIteration:
    128         return False

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\traitlets\traitlets.py:1371, in HasTraits.hold_trait_notifications(self)
   1369 for changes in cache.values():
   1370     for change in changes:
-> 1371         self.notify_change(change)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\ipywidgets\widgets\widget.py:686, in Widget.notify_change(self, change)
    683     if name in self.keys and self._should_send_property(name, getattr(self, name)):
    684         # Send new state to front-end
    685         self.send_state(key=name)
--> 686 super(Widget, self).notify_change(change)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\traitlets\traitlets.py:1386, in HasTraits.notify_change(self, change)
   1384 def notify_change(self, change):
   1385     """Notify observers of a change event"""
-> 1386     return self._notify_observers(change)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\traitlets\traitlets.py:1431, in HasTraits._notify_observers(self, event)
   1428 elif isinstance(c, EventHandler) and c.name is not None:
   1429     c = getattr(self, c.name)
-> 1431 c(event)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\nwbwidgets\base.py:161, in lazy_tabs.<locals>.on_selected_index(change)
    159 def on_selected_index(change):
    160     if isinstance(change.owner.children[change.new], widgets.HTML):
--> 161         children[change.new] = vis2widget(tabs_spec[change.new][1](node))
    162         change.owner.children = children

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\nwbwidgets\misc.py:1188, in RasterGridWidget.__init__(self, units, trials, unit_index, units_trials_controller)
   1179     units_trials_controller = UnitsAndTrialsControllerWidget(
   1180         units=units,
   1181         trials=trials,
   1182         unit_index=unit_index
   1183     )
   1184     self.children = [units_trials_controller]
   1186 self.fig = interactive_output(
   1187     f=raster_grid,
-> 1188     controls=units_trials_controller.controls,
   1189     fixed=units_trials_controller.fixed
   1190 )
   1192 self.children += tuple([self.fig])

AttributeError: 'UnitsAndTrialsControllerWidget' object has no attribute 'controls'
@rcpeene rcpeene changed the title Fails to render Tabs in neuronal units. Fails to render tabs in neuronal units section. Dec 8, 2022
@CodyCBakerPhD
Copy link
Collaborator

Hi there - sorry for the delayed response

Quick question while we look into this - what version of NWB Widgets are you using?

@CodyCBakerPhD CodyCBakerPhD added the bug Something isn't working label Dec 16, 2022
@rcpeene
Copy link
Author

rcpeene commented Dec 16, 2022

version 0.10.0

@CodyCBakerPhD
Copy link
Collaborator

Can confirm this is still an issue in v0.10.1

For easy reproducibility

import h5py
import fsspec
from fsspec.implementations.cached import CachingFileSystem
from pynwb import NWBHDF5IO

s3_url = "https://dandiarchive.s3.amazonaws.com/blobs/f5f/175/f5f1752f-5227-47d5-8f75-cd71937878aa"
cfs = CachingFileSystem(
    fs=fsspec.filesystem("http"),
    cache_storage="/home/jovyan/fsspec_cache",  # Local folder for the cache
)
file_system = cfs.open(s3_url, "rb")
file = h5py.File(file_system)
io = NWBHDF5IO(file=file, load_namespaces=True)
nwbfile = io.read()

Then navigate to Units/tuning tab

I was also surprised at how long the units section took to render, guessing that's due to it loading in all unit properties (including spike features like amplitude)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants