Closed oruebel closed 7 months ago
@rly I'll submit a PR with a fix for hdmf_zarr, however, I'm wondering whether a more approbriat fix would be to update the behavior of get_data_shape
in hdmf to make sure we don't return shapes that include None values. However, I do not recall whether that is intended behavior of get_data_shape
and why this may be needed. Alternatively, we could also add a flag to get_data_shape
to allow use to configure whether None
values are allowed in the returned shape or not. Thoughts?
What happened?
When converting an HDF5 dataset to Zarr where the HDF5 dataset has an unlimited dimension, the
data_shape
will includeNone
values for the unlimited dimensions whenget_data_shape
is being called"https://github.com/hdmf-dev/hdmf-zarr/blob/71bfa6d7d66223227527463c3f829025fa7124fd/src/hdmf_zarr/backend.py#L1195-L1196
This is because
hdmf.utils.get_data_shape
looks at themaxshape
of the data first rather than returning the actual shape https://github.com/hdmf-dev/hdmf/blob/8892ba6472d9751ff44b977a1d5a50e6512d3b05/src/hdmf/utils.py#L902-L903However, the data shape when creating a new dataset in Zarr cannot contain None values, i.e., it must be a tuple of only integer values.
Steps to Reproduce
Traceback
Operating System
Linux
Python Executable
Conda
Python Version
3.11
Package Versions
No response
Code of Conduct