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

S3 test #206

Merged
merged 5 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.9.0 (Upcoming)
### Enhancements
* NWBZarrIO load_namespaces=True by default. @mavaylon1 [#204](https://github.com/hdmf-dev/hdmf-zarr/pull/204)
* Added test for opening file with consolidated metadata from DANDI. @mavaylon1 [#206](https://github.com/hdmf-dev/hdmf-zarr/pull/206)

## 0.8.0 (June 4, 2024)
### Bug Fixes
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/test_fsspec_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from hdmf_zarr import NWBZarrIO
from .utils import check_s3fs_ffspec_installed

import zarr

HAVE_FSSPEC = check_s3fs_ffspec_installed()


Expand All @@ -24,3 +26,16 @@ def test_fsspec_streaming(self):
self.assertEqual(len(nwbfile.electrode_groups), 2)
self.assertEqual(len(nwbfile.electrodes), 1152)
self.assertEqual(nwbfile.institution, "AIND")

@unittest.skipIf(not HAVE_FSSPEC, "fsspec not installed")
def test_s3_open_with_consolidated_(self):
"""
The file is a Zarr file with consolidated metadata.
"""
s3_path = "https://dandiarchive.s3.amazonaws.com/zarr/ccefbc9f-30e7-4a4c-b044-5b59d300040b/"
mavaylon1 marked this conversation as resolved.
Show resolved Hide resolved
with NWBZarrIO(s3_path, mode='r') as read_io:
read_io.open()
self.assertIsInstance(read_io.file.store, zarr.storage.ConsolidatedMetadataStore)
mavaylon1 marked this conversation as resolved.
Show resolved Hide resolved
with NWBZarrIO(s3_path, mode='-r') as read_io:
read_io.open()
self.assertIsInstance(read_io.file.store, zarr.storage.FSStore)
1 change: 0 additions & 1 deletion tests/unit/test_zarrio.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,3 @@ def test_force_open_without_consolidated_fails(self):
read_io._ZarrIO__open_file_consolidated(store=self.store, mode='r')
except ValueError as e:
self.fail("ZarrIO.__open_file_consolidated raised an unexpected ValueError: {}".format(e))

Loading