Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Restrict hdmf version in build for hdmf-zarr 0.9.0 #267

Closed
samuelbray32 opened this issue Mar 6, 2025 · 2 comments
Closed

[Bug]: Restrict hdmf version in build for hdmf-zarr 0.9.0 #267

samuelbray32 opened this issue Mar 6, 2025 · 2 comments

Comments

@samuelbray32
Copy link

What happened?

Tracked down a user build error. Easy to solve with upgraded version but documenting here:

  • This line in hdmf-zarr = 0.9.0:

    from hdmf.array import Array

    Is not compatible with hdmf >= 4.0.0

  • Compatibility issue solved in hdmf-zarr = 0.10.0. Don't think this error would show up for many people.

  • Restricting hdmf>=3.14.3, <4.0.0, version in the 0.9.0 release would prevent error

Steps to Reproduce

User built environment from this repo: https://github.com/LorenFrankLab/trodes_to_nwb

Traceback

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[2], line 3
      1 from trodes_to_nwb.data_scanner import get_file_info
      2 from trodes_to_nwb.convert_yaml import load_metadata
----> 3 from trodes_to_nwb.convert import _get_file_paths
      4 from trodes_to_nwb.convert_rec_header import read_header, detect_ptp_from_header
      5 from trodes_to_nwb.convert_position import add_position

File ~/Src/trodes_to_nwb/src/trodes_to_nwb/convert.py:5
      2 import os
      3 from pathlib import Path
----> 5 import nwbinspector
      6 import pandas as pd
      7 from dask.distributed import Client

File ~/miniforge3/envs/trodes_to_nwb/lib/python3.13/site-packages/nwbinspector/__init__.py:6
      4 from ._types import Importance, Severity, InspectorMessage
      5 from ._configuration import load_config, validate_config, configure_checks
----> 6 from ._nwb_inspection import (
      7     inspect_all,
      8     inspect_nwbfile,
      9     inspect_nwbfile_object,
     10     run_checks,
     11 )
     12 from ._formatting import (
     13     format_messages,
     14     print_to_console,
   (...)     18     InspectorOutputJSONEncoder,
     19 )
     20 from ._organization import organize_messages

File ~/miniforge3/envs/trodes_to_nwb/lib/python3.13/site-packages/nwbinspector/_nwb_inspection.py:12
      9 from warnings import filterwarnings, warn
     11 import pynwb
---> 12 from hdmf_zarr import ZarrIO
     13 from natsort import natsorted
     14 from tqdm import tqdm

File ~/miniforge3/envs/trodes_to_nwb/lib/python3.13/site-packages/hdmf_zarr/__init__.py:1
----> 1 from .backend import ZarrIO
      2 from .utils import ZarrDataIO
      3 from .nwb import NWBZarrIO

File ~/miniforge3/envs/trodes_to_nwb/lib/python3.13/site-packages/hdmf_zarr/backend.py:24
     18 # HDMF-ZARR imports
     19 from .utils import (ZarrDataIO,
     20                     ZarrReference,
     21                     ZarrSpecWriter,
     22                     ZarrSpecReader,
     23                     ZarrIODataChunkIteratorQueue)
---> 24 from .zarr_utils import BuilderZarrReferenceDataset, BuilderZarrTableDataset
     26 # HDMF imports
     27 from hdmf.backends.io import HDMFIO

File ~/miniforge3/envs/trodes_to_nwb/lib/python3.13/site-packages/hdmf_zarr/zarr_utils.py:14
     12 from hdmf.build import DatasetBuilder
     13 from hdmf.data_utils import append_data
---> 14 from hdmf.array import Array
     15 from hdmf.query import HDMFDataset, ReferenceResolver, ContainerResolver, BuilderResolver
     16 from hdmf.utils import docval, popargs, get_docval

ModuleNotFoundError: No module named 'hdmf.array'

Operating System

Linux

Python Version

3.13

Package Versions

hdmf=4.0.0
hdmf_zarr=0.9.0
nwbinspector=0.6.3
pynwb=3.0.0

@rly
Copy link
Contributor

rly commented Mar 7, 2025

Hi @samuelbray32 . To be clear, upgrading hdmf-zarr to 0.10.0 resolves the error and downgrading hdmf < 4.0.0 also resolves the error. Is that right? Is there a reason why the user cannot upgrade hdmf-zarr to 0.10.0?

Releases like 0.9.0 are final and cannot (should not) be changed. Unfortunately this can result in incompatibilities between packages if one is pinned and another is upgraded, like how numpy 1.0 from 2006 is not compatible with most modern python packages. We could create an hdmf-zarr 0.9.1 fix that branches off from hdmf-zarr 0.9.0 if the user cannot upgrade to hdmf-zarr 0.10.0 but would need to understand the use case better.

@samuelbray32
Copy link
Author

Hi @rly, yes that's correct, upgrading was sufficient to resolve. Was just posting this as documentation for anyone else who get the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants