Skip to content

Add ZarrArrayExtractor to read "plain" Zarr arrays - #4760

Draft
chrishalcrow wants to merge 6 commits into
SpikeInterface:mainfrom
chrishalcrow:add-zarr-file-reader
Draft

Add ZarrArrayExtractor to read "plain" Zarr arrays#4760
chrishalcrow wants to merge 6 commits into
SpikeInterface:mainfrom
chrishalcrow:add-zarr-file-reader

Conversation

@chrishalcrow

Copy link
Copy Markdown
Member

This PR adds a read_zarr_array function which reads a Zarr array as a recording object (in the same way that read_binary reads a binary array).

Currently, we support reading Zarr files which have been generated by SpikeInterface. A big use case for Zarr is that it gives easy access to nice compression algorithms, and users may want to compress their raw data and delete it. But at the moment we only allow access to these through SpikeInterface. This makes SpikeInterface a dependency for reading your raw data: not ideal!

Instead, a user might use zarr directly to compress their binary arrays. This PR adds the functionality to read these externally-generated zarr-arrays. With a couple of tweaks, we can use all the existing zarr functionality, woo!

I've made this as lightweight as possible - even stripping out some kwargs that read_binary uses. I might have pruned too much.

Tests incoming...

@chrishalcrow chrishalcrow added this to the 0.105.0 milestone Sep 4, 2026
@chrishalcrow chrishalcrow changed the title Add ZarrArrayExtractor to read "plain" Zarr files Add ZarrArrayExtractor to read "plain" Zarr arrays Sep 4, 2026
@chrishalcrow chrishalcrow added the extractors Related to extractors module label Sep 4, 2026
Comment thread src/spikeinterface/core/zarrextractors.py Outdated
Comment thread src/spikeinterface/core/zarrextractors.py Outdated
sampling_frequency: float,
gain_to_uV: float | np.ndarray | None = None,
offset_to_uV: float | np.ndarray | None = None,
is_filtered: bool | None = None,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be None?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extractors Related to extractors module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants