hdmf-dev / hdmf

The Hierarchical Data Modeling Framework
http://hdmf.readthedocs.io
Other
46 stars 24 forks source link

[Bug]: np.string_ issue on Windows CI #1130

Open CodyCBakerPhD opened 2 weeks ago

CodyCBakerPhD commented 2 weeks ago

What happened?

Caught by NWB Inspector daily tests: https://github.com/NeurodataWithoutBorders/nwbinspector/actions/runs/9549108007/job/26317937248#step:12:57

Steps to Reproduce

Make simple example files

https://github.com/NeurodataWithoutBorders/nwbinspector/actions/runs/9549108007/job/26317937248#step:12:194

Traceback

https://github.com/NeurodataWithoutBorders/nwbinspector/actions/runs/9549108007/job/26317937248#step:12:453

from https://github.com/hdmf-dev/hdmf/blob/d756abeb98ef89fde37a71ed64ec84de627f8bfb/src/hdmf/build/objectmapper.py#L302

Operating System

macOS

Python Executable

Conda

Python Version

3.12

Package Versions

https://github.com/NeurodataWithoutBorders/nwbinspector/actions/runs/9549108007/job/26317937248#step:6:339

rly commented 2 weeks ago

This failure is due to numpy 2.0. https://numpy.org/devdocs/numpy_2_0_migration_guide.html

HDMF does not yet support numpy 2.0 (https://github.com/hdmf-dev/hdmf/issues/1106). It appears that the nwbinspector test installs h5py with ROS3 from conda-forge, which installs numpy 2.0 from conda-forge. When the latest HDMF is installed by pip, it installs numpy<2.0, but because numpy 2.0 was installed by conda and numpy<2.0 was installed by pip, it looks like the 2.0 version from conda takes priority and results in this error.

We will address this in HDMF but probably not this week given our travel. If possible, it may be better to address this in the inspector workflow.