Skip to content

Commit 742bfb4

Browse files
fix #298 (#301)
* sorted * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * changelog * files names --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7bfb2f4 commit 742bfb4

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### New features
44
* Improved browsing and reading local NWB files with Panel, using ipyfilechooser [PR #300](https://github.com/NeurodataWithoutBorders/nwbwidgets/pull/300)
5+
* Improve readibility of dandisets and files dropdown lists [PR #301](https://github.com/NeurodataWithoutBorders/nwbwidgets/pull/301)
56

67
### Fixes
78
* Fix I/O issues when streaming data on Panel [PR #295](https://github.com/NeurodataWithoutBorders/nwbwidgets/pull/295)

nwbwidgets/panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def create_components_dandi_source(self, args=None):
109109
dandiset_options.append(item_name)
110110

111111
self.source_dandi_id = widgets.Dropdown(
112-
options=dandiset_options,
112+
options=sorted(dandiset_options),
113113
description="Dandiset:",
114114
layout=widgets.Layout(width="400px", overflow=None),
115115
)

nwbwidgets/utils/dandi.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ def get_dandiset_metadata(dandiset_id: str):
1111
def list_dandiset_files(dandiset_id: str):
1212
with DandiAPIClient() as client:
1313
dandiset = client.get_dandiset(dandiset_id=dandiset_id, version_id="draft")
14-
return [i.dict().get("path") for i in dandiset.get_assets() if i.dict().get("path").endswith(".nwb")]
14+
return sorted(
15+
[
16+
i.dict().get("path").split("/")[-1]
17+
for i in dandiset.get_assets()
18+
if i.dict().get("path").endswith(".nwb")
19+
]
20+
)
1521

1622

1723
def get_file_url(dandiset_id: str, file_path: str):

0 commit comments

Comments
 (0)