Description
All roundtrip integration tests for image and ophys types are failing across all platforms and Python versions on dev with:
TypeError: DatasetBuilder.__init__: incorrect type for 'data' (got 'uint64', expected
'ndarray, list, tuple, Dataset, StrDataset, HDMFDataset, AbstractDataChunkIterator,
str, int, float, bytes, bool, datetime, date, DataIO, DatasetBuilder, Iterable,
datetime or date')
The error occurs during write (building the DatasetBuilder), not during read.
Affected tests
All failing in tests/integration/hdf5/:
test_image.TestImageSeriesIO (roundtrip, roundtrip_export)
test_image.TestOpticalSeriesIO (roundtrip, roundtrip_export)
test_image.TestOpticalSeriesOptionalFieldsIO (roundtrip, roundtrip_export)
test_ophys.MaskIO (roundtrip, roundtrip_export)
test_ophys.TestCorrectedImageStackIO (roundtrip, roundtrip_export)
test_ophys.TestImageMaskIO (roundtrip, roundtrip_export)
test_ophys.TestMotionCorrection (roundtrip, roundtrip_export)
test_ophys.TestOnePhotonSeriesIO (roundtrip, roundtrip_export)
- And more (24 errors total)
All platforms (ubuntu, macos, windows) and Python versions (3.10, 3.14) affected.
Root cause
A numpy.uint64 scalar is being passed as data to DatasetBuilder.__init__, which HDMF's docval rejects because numpy scalar types are not in its accepted types list. This is likely a regression from an HDMF update — numpy scalar types such as numpy.uint64 may have previously been accepted (e.g., via the int check or an Iterable fallback) but are now being rejected.
Example traceback
File "pynwb/testing/testh5io.py", line 97, in roundtripContainer
write_io.write(nwbfile, cache_spec=cache_spec)
File "hdmf/backends/hdf5/h5tools.py", line 328, in write
super().write(**kwargs)
File "hdmf/backends/io.py", line 92, in write
f_builder = self.__manager.build(container, source=self.__source, root=True)
...
TypeError: DatasetBuilder.__init__: incorrect type for 'data' (got 'uint64', ...)
Fix
Either:
- Identify where a
numpy.uint64 scalar is being set on an image/ophys container in pynwb and cast it to a supported type (e.g., int), or
- File upstream in hdmf-dev/hdmf to accept numpy scalar types in
DatasetBuilder.
Seen on CI run: https://github.com/NeurodataWithoutBorders/pynwb/actions/runs/25932538893
Description
All roundtrip integration tests for image and ophys types are failing across all platforms and Python versions on
devwith:The error occurs during write (building the
DatasetBuilder), not during read.Affected tests
All failing in
tests/integration/hdf5/:test_image.TestImageSeriesIO(roundtrip, roundtrip_export)test_image.TestOpticalSeriesIO(roundtrip, roundtrip_export)test_image.TestOpticalSeriesOptionalFieldsIO(roundtrip, roundtrip_export)test_ophys.MaskIO(roundtrip, roundtrip_export)test_ophys.TestCorrectedImageStackIO(roundtrip, roundtrip_export)test_ophys.TestImageMaskIO(roundtrip, roundtrip_export)test_ophys.TestMotionCorrection(roundtrip, roundtrip_export)test_ophys.TestOnePhotonSeriesIO(roundtrip, roundtrip_export)All platforms (ubuntu, macos, windows) and Python versions (3.10, 3.14) affected.
Root cause
A
numpy.uint64scalar is being passed asdatatoDatasetBuilder.__init__, which HDMF'sdocvalrejects because numpy scalar types are not in its accepted types list. This is likely a regression from an HDMF update — numpy scalar types such asnumpy.uint64may have previously been accepted (e.g., via theintcheck or anIterablefallback) but are now being rejected.Example traceback
Fix
Either:
numpy.uint64scalar is being set on an image/ophys container in pynwb and cast it to a supported type (e.g.,int), orDatasetBuilder.Seen on CI run: https://github.com/NeurodataWithoutBorders/pynwb/actions/runs/25932538893