-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add streaming test (currently very slow)
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import unittest | ||
|
||
|
||
try: | ||
import s3fs | ||
import fsspec | ||
HAVE_FSSPEC = True | ||
except ImportError: | ||
HAVE_FSSPEC = False | ||
|
||
|
||
from hdmf_zarr import NWBZarrIO | ||
|
||
|
||
class TestFSSpecStreaming(unittest.TestCase): | ||
|
||
@unittest.skipIf(not HAVE_FSSPEC, "fsspec not installed") | ||
def test_fsspec_streaming(self): | ||
# PLACEHOLDER test file from Allen Insitute for Neural Dynamics | ||
# TODO: store a small test file and use it to speed up testing | ||
remote_path = "s3://aind-open-data/ecephys_625749_2022-08-03_15-15-06_nwb_2023-05-16_16-34-55/ecephys_625749_2022-08-03_15-15-06_nwb/ecephys_625749_2022-08-03_15-15-06_experiment1_recording1.nwb.zarr/" | ||
|
||
with NWBZarrIO(remote_path, "r") as io: | ||
nwbfile = io.read() | ||
|
||
self.assertEqual(nwbfile.identifier, "ecephys_625749_2022-08-03_15-15-06") | ||
self.assertEqual(len(nwbfile.devices), 2) | ||
self.assertEqual(len(nwbfile.electrode_groups), 2) | ||
self.assertEqual(len(nwbfile.electrodes), 1152) | ||
self.assertEqual(nwbfile.institution, "AIND") |