Skip to content

Support NWB files stored as Zarr (.nwb.zarr) #1920

Open

Description

@h-mayorquin

Same context as the other two issues, 1 and 2 but now I have realized (I should have thought about this before) that dandi-cli has no support for NWB stored as Zarr: a .nwb.zarr. Currently, this is handled as a generic Zarr asset, so none of the NWB machinery ever sees it.

In my specific case described on the issues above two things happend:

  • The validation does not stop the upload in its tracks if the referenced videos are missing.
  • dandi organize skips the .nwb.zarr file silently, no entry, no warning, no error.

I am not sure adding support is mechanically hard but there is a dependency problem. Reading of the file is supported by the backend independent pynwb.read_nwb, which is able to handle the two backends as long as hdmf-zarr is installed. That covers _get_pynwb_metadata, and validate already goes through pynwb.validate(paths=...) on its main path. Then there are the following sites that read quickly and where doing the full nwb read is probably too heavy, they will require a backend specific branch:

  • get_nwb_version, which opens the file only to read one root attribute.
  • get_object_id, same thing for object_id.
  • get_neurodata_types and its _scan_neurodata_types helper, which walk the raw tree looking for neurodata_type.
  • nwb_has_external_links, the gate that refuses files whose content lives in other files. hdmf-zarr has links with a source too, so this ports the same way.

I can take the above if that makes sense for you but the thorny issue is dependencies. nwb.zarr will require Python 3.12 and zarr 3.2 or above, see the version discussion in hdmf-zarr. Currently you have zarr pinned to zarr>=2.18.0,<=3.1.5. Is there a reason for this? How could we move forward?

Activity

  1. bendichter commented on Sep 15, 2026

    @bendichter
    Member

    We discussed this together on the call on Sep 14 2026. The zarr ceiling has no reason behind it that anyone remembers. It was bumped to 3.1.5 without explanation, and the earlier cap was most likely a workaround for a numcodecs incompatibility that has since been fixed. Raising it should be a mechanical change, so please go ahead.

    On Python, dandi-cli will drop 3.11 so that it can pick up hdmf-zarr with zarr 3. The plan is two releases:

    1. A patch release on the current series that still supports 3.11 and emits a warning when it encounters a .nwb.zarr file, telling the user they need Python 3.12 and a newer dandi-cli.
    2. Minor release that drops 3.11, raises the zarr ceiling, and adds the .nwb.zarr support you describe above.

    The list of sites you gave looks right to me, and it would be great if you took that on. The one thing to be careful about is CI, so that 3.11 users keep resolving to the older version cleanly.

  2. yarikoptic commented on Sep 25, 2026

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions