Skip to content

Commit

Permalink
Merge pull request #112 from int-brain-lab/hotfix/2.5.5
Browse files Browse the repository at this point in the history
hotfix 2.5.5 resolves #111
  • Loading branch information
k1o0 authored Jan 17, 2024
2 parents 3e4fa50 + 0db326a commit 9377e7f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog
## [Latest](https://github.com/int-brain-lab/ONE/commits/main) [2.5.4]
## [Latest](https://github.com/int-brain-lab/ONE/commits/main) [2.5.5]

### Modified

- HOTFIX: no eid in frame index when calling list_datasets with eid and details = True

## [2.5.4]

### Modified

Expand All @@ -23,7 +29,7 @@

- HOTFIX: exclude irrelevant s3 objects with source name in key, e.g. for foo/bar exclude foo/bar_baz/ key

## [Latest](https://github.com/int-brain-lab/ONE/commits/main) [2.5.0]
## [2.5.0]

### Added

Expand Down
2 changes: 1 addition & 1 deletion one/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""The Open Neurophysiology Environment (ONE) API."""
__version__ = '2.5.4'
__version__ = '2.5.5'
3 changes: 2 additions & 1 deletion one/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1722,8 +1722,9 @@ def list_datasets(self, eid=None, filename=None, collection=None, revision=None,
self._update_cache_from_records(sessions=session, datasets=datasets.copy())
if datasets is None or datasets.empty:
return self._cache['datasets'].iloc[0:0] if details else [] # Return empty
assert set(datasets.index.unique('eid')) == {eid}
datasets = util.filter_datasets(
datasets, assert_unique=False, wildcards=self.wildcards, **filters)
datasets.droplevel('eid'), assert_unique=False, wildcards=self.wildcards, **filters)
# Return only the relative path
return datasets if details else datasets['rel_path'].sort_values().values.tolist()

Expand Down
3 changes: 3 additions & 0 deletions one/tests/test_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,12 @@ def test_list_datasets(self):
dsets = self.one.list_datasets(details=True)
self.assertEqual(len(dsets), len(self.one._cache.datasets))
self.assertFalse(dsets is self.one._cache.datasets)
self.assertEqual(2, dsets.index.nlevels, 'details data frame should be with eid index')

# Test list for eid
dsets = self.one.list_datasets('KS005/2019-04-02/001', details=True)
self.assertEqual(27, len(dsets))
self.assertEqual(1, dsets.index.nlevels, 'details data frame should be without eid index')

# Test filters
filename = {'attribute': ['times', 'intervals'], 'extension': 'npy'}
Expand Down Expand Up @@ -1281,6 +1283,7 @@ def test_list_datasets(self):

dsets = self.one.list_datasets(self.eid, details=True, query_type='remote')
self.assertEqual(171, len(dsets)) # this may change after a BWM release or patch
self.assertEqual(1, dsets.index.nlevels, 'details data frame should be without eid index')

# Test missing eid
dsets = self.one.list_datasets('FMR019/2021-03-18/008', details=True, query_type='remote')
Expand Down

0 comments on commit 9377e7f

Please sign in to comment.