Skip to content

Commit

Permalink
Merge pull request #281 from NeurodataWithoutBorders/fix_trials
Browse files Browse the repository at this point in the history
rmv trials from outer accordian
  • Loading branch information
CodyCBakerPhD authored Feb 24, 2023
2 parents b228e6a + 4705b2f commit 62e4ad2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions nwbwidgets/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def show_nwbfile(nwbfile: NWBFile, neurodata_vis_spec: dict) -> widgets.Widget:
lbl_names = widgets.Label(value, layout=field_lay)
hbox_exp = widgets.HBox(children=[lbl_experimenter, lbl_names])
info.append(hbox_exp)
elif key == "trials":
continue
elif (isinstance(value, Iterable) and len(value)) or value:
neuro_data.append(value)
if getattr(value, "description", None):
Expand Down
15 changes: 10 additions & 5 deletions nwbwidgets/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ def __init__(
NWB widgets Panel for visualization of NWB files.
Args:
stream_mode (str, optional): Either "fsspec" or "ros3". Defaults to "fsspec".
cache_path (str, optional): The path to cached data if streaming with "fsspec". If left as None, a directory "nwb-cache" is created under the current working directory. Defaults to None.
enable_dandi_source (bool, optional): Enable DANDI source option. Defaults to True.
enable_s3_source (bool, optional): Enable S3 source option. Defaults to True.
enable_local_source (bool, optional): Enable local source option. Defaults to True.
stream_mode : {'fsspec', 'ros3'}
cache_path : str, optional
The path to cached data if streaming with "fsspec". If left as None, a directory "nwb-cache" is
created under the current working directory. Defaults to None.
enable_dandi_source : bool, default: True
Enable DANDI source option.
enable_s3_source : bool, default: true
Enable S3 source option.
enable_local_source : bool, default: True
Enable local source option.
"""
super().__init__(children=[], **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion nwbwidgets/utils/dandi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_dandiset_metadata(dandiset_id: str):
def list_dandiset_files(dandiset_id: str):
with DandiAPIClient() as client:
dandiset = client.get_dandiset(dandiset_id=dandiset_id, version_id="draft")
return [i.dict().get("path") for i in dandiset.get_assets()]
return [i.dict().get("path") for i in dandiset.get_assets() if i.dict().get("path").endswith(".nwb")]


def get_file_url(dandiset_id: str, file_path: str):
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ trimesh
dandi
importlib-metadata <5.0
fsspec
requests
aiohttp
ipydatawidgets==4.3.2
5 changes: 5 additions & 0 deletions test/test_panel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from nwbwidgets import Panel


def test_panel():
Panel()

0 comments on commit 62e4ad2

Please sign in to comment.