hdmf-dev / hdmf-zarr

Zarr I/O backend for HDMF
https://hdmf-zarr.readthedocs.io/
Other
7 stars 7 forks source link

[Bug]: Pre-release daily workflows failing with zarr 3.0.0a0 #200

Closed rly closed 1 month ago

rly commented 1 month ago

What happened?

All pre-release daily workflows are failing. https://github.com/hdmf-dev/hdmf-zarr/actions/runs/9559407286

It looks like they install the latest zarr 3.0.0 pre-release, 3.0.0a0, which was released last week.

I think this can be addressed by changing from zarr.hierarchy import Group to from zarr import Group. I will give it a try.

Steps to Reproduce

Run tests with zarr 3.0.0a0

Traceback

/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/unit/test_io_convert.py:43: in <module>
    from hdmf_zarr.backend import (ZarrIO,
.tox/py312-prerelease/lib/python3.12/site-packages/hdmf_zarr/__init__.py:1: in <module>
    from .backend import ZarrIO
.tox/py312-prerelease/lib/python3.12/site-packages/hdmf_zarr/backend.py:11: in <module>
    from zarr.hierarchy import Group
E   ModuleNotFoundError: No module named 'zarr.hierarchy'

Operating System

Linux

Python Executable

Conda

Python Version

3.12

Package Versions

No response

Code of Conduct

rly commented 1 month ago

Attempting to fix this proved to be more than a few minutes of import changes. The Zarr Python API changes quite a bit from v2 to v3, and it seems like some things that we use like ProcessSynchronizer and ThreadSynchronizer have been removed/replaced. I haven't looked deeply into it yet. But for now, I think we should limit zarr<3 until we can provide proper zarr-python v3 support

oruebel commented 1 month ago

some things that we use like ProcessSynchronizer and ThreadSynchronizer have been removed/replaced.

The main part where the synchronizers come in is in how we open the file:

https://github.com/hdmf-dev/hdmf-zarr/blob/58e2d4563a86835af27a9cb7e6b155777da1d699/src/hdmf_zarr/backend.py#L158

and then that is being configured in the __init__ is here:

https://github.com/hdmf-dev/hdmf-zarr/blob/58e2d4563a86835af27a9cb7e6b155777da1d699/src/hdmf_zarr/backend.py#L109-L116

We are really not doing anything special with the synchronizers and in most common cases, I think the synchronizer is not being used (I think this mainly comes in for parallel I/O). So if we need to update this for Zarr 3, I think we should be able doable to keep the changes centered around file open logic.