Skip to content

Keep spikeinterface importable when zarr-python v3 is installed - #4751

Merged
alejoe91 merged 1 commit into
SpikeInterface:mainfrom
h-mayorquin:zarr_group_annotation
Sep 3, 2026
Merged

Keep spikeinterface importable when zarr-python v3 is installed#4751
alejoe91 merged 1 commit into
SpikeInterface:mainfrom
h-mayorquin:zarr_group_annotation

Conversation

@h-mayorquin

Copy link
Copy Markdown
Contributor

I am testing the zarr migration and as you know hdmf-zarr is what is keeping us from moving forward:
hdmf-dev/hdmf-zarr#325
hdmf-dev/hdmf-zarr#366

For testing I am making small changes here that allow me to keep spikeinterface in the environment without adding read support from version 3. Those changes are minimal:

  1. Typing in the zarrextractors and in nwb
  2. Handle the string dtype on main ids.
  3. No len() on zarr arrays in the zarr sorting extractor, v3 arrays do not have it. I asked about this on the zarr repo if you are curious.

This is way smaller than #4260 which is the complete thing and it does not make the zarr extractors write v3, it only keeps the import and the reading paths alive for people who have zarr 3 in the environment for another package. Loading an analyzer from a zarr folder still fails under 3 and that one really needs the migration. This will make future integration easier I feel : )

Note that 2 is useful more generally and I think we should support the new string dtype in general but I just wanted to do a surgical change here.

Four v2-only spellings that break under v3 and stay valid under 2.18: the
zarr.hierarchy.Group annotations, evaluated at import time, zarr.open's
positional mode and its use as a context manager, len() on the zarr arrays of
the sorting extractor, and the main-ids guard that does not know numpy's
variable-width StringDType.
@h-mayorquin h-mayorquin self-assigned this Sep 2, 2026

@alejoe91 alejoe91 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds good to me!

@alejoe91 alejoe91 added dependencies Issue/PR that is related to dependencies core Changes to core module labels Sep 3, 2026
@alejoe91
alejoe91 merged commit 80beb69 into SpikeInterface:main Sep 3, 2026
17 checks passed
@h-mayorquin
h-mayorquin deleted the zarr_group_annotation branch September 3, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to core module dependencies Issue/PR that is related to dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants