Skip to content

Commit

Permalink
add zarr arguments (#2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin authored May 25, 2024
1 parent 63a8442 commit 790715c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/spikeinterface/extractors/nwbextractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ class NwbRecordingExtractor(BaseRecording):
stream_cache_path: str, Path, or None, default: None
Specifies the local path for caching the file. Relevant only if `cache` is True.
storage_options: dict | None = None,
Additional parameters for the storage backend (e.g. AWS credentials) used for "zarr" stream_mode.
These are the additional kwargs (e.g. AWS credentials) that are passed to the zarr.open convenience function.
This is only used on the "zarr" stream_mode.
use_pynwb: bool, default: False
Uses the pynwb library to read the NWB file. Setting this to False, the default, uses h5py
to read the file. Using h5py can improve performance by bypassing some of the PyNWB validations.
Expand Down Expand Up @@ -861,8 +862,10 @@ def _fetch_main_properties_backend(self):

@staticmethod
def fetch_available_electrical_series_paths(
file_path: str | Path, stream_mode: Optional[Literal["fsspec", "remfile", "zarr"]] = None
) -> List[str]:
file_path: str | Path,
stream_mode: Optional[Literal["fsspec", "remfile", "zarr"]] = None,
storage_options: dict | None = None,
) -> list[str]:
"""
Retrieves the paths to all ElectricalSeries objects within a neurodata file.
Expand All @@ -873,7 +876,9 @@ def fetch_available_electrical_series_paths(
stream_mode : "fsspec" | "remfile" | "zarr" | None, optional
Determines the streaming mode for reading the file. Use this for optimized reading from
different sources, such as local disk or remote servers.
storage_options: dict | None = None,
These are the additional kwargs (e.g. AWS credentials) that are passed to the zarr.open convenience function.
This is only used on the "zarr" stream_mode.
Returns
-------
list of str
Expand Down Expand Up @@ -901,6 +906,7 @@ def fetch_available_electrical_series_paths(
file_handle = read_file_from_backend(
file_path=file_path,
stream_mode=stream_mode,
storage_options=storage_options,
)

electrical_series_paths = _find_neurodata_type_from_backend(
Expand Down Expand Up @@ -988,7 +994,8 @@ class NwbSortingExtractor(BaseSorting):
If True, the file is cached in the file passed to stream_cache_path
if False, the file is not cached.
storage_options: dict | None = None,
Additional parameters for the storage backend (e.g. AWS credentials) used for "zarr" stream_mode.
These are the additional kwargs (e.g. AWS credentials) that are passed to the zarr.open convenience function.
This is only used on the "zarr" stream_mode.
use_pynwb: bool, default: False
Uses the pynwb library to read the NWB file. Setting this to False, the default, uses h5py
to read the file. Using h5py can improve performance by bypassing some of the PyNWB validations.
Expand Down

0 comments on commit 790715c

Please sign in to comment.