What happened?
Zarr attributes fail to validate against an attribute spec with dtype=float64. This is because Zarr reads the attributes (in .zattrs, a JSON file), as Python-native float, and the HDMF validator reads float values as dtype="float" which in HDMF aliases to float32. This is incorrect because Python-native floats are 64-bit.
Similarly, Python-native int has unlimited precision and so should be aliased to int64, not int32.
NWBHDF5IO/h5py reads scalars as numpy objects with numpy dtypes so this is not an issue there.
I believe this issue would also come up when validating in-memory, unwritten files.
This is blocking validation of some Allen Institute zarr files that have an extension with an attribute with float64 dtype.
Steps to Reproduce
Traceback
Operating System
Windows
Python Version
3.13
Package Versions
No response
What happened?
Zarr attributes fail to validate against an attribute spec with dtype=float64. This is because Zarr reads the attributes (in
.zattrs, a JSON file), as Python-nativefloat, and the HDMF validator reads float values as dtype="float" which in HDMF aliases to float32. This is incorrect because Python-native floats are 64-bit.Similarly, Python-native
inthas unlimited precision and so should be aliased to int64, not int32.NWBHDF5IO/h5py reads scalars as numpy objects with numpy dtypes so this is not an issue there.
I believe this issue would also come up when validating in-memory, unwritten files.
This is blocking validation of some Allen Institute zarr files that have an extension with an attribute with float64 dtype.
Steps to Reproduce
Traceback
Operating System
Windows
Python Version
3.13
Package Versions
No response