NeurodataWithoutBorders / pynwb

A Python API for working with Neurodata stored in the NWB Format
https://pynwb.readthedocs.io
Other
176 stars 85 forks source link

[Documentation]: Invalid(?) dtype in general/extensions.py tutorial #1952

Open ehennestad opened 2 weeks ago

ehennestad commented 2 weeks ago

What would you like changed or added to the documentation and why?

in the general/extensions.py tutorial, one of the dtype values is set to uint https://github.com/NeurodataWithoutBorders/pynwb/blob/2d00afe30b3116c714e53a39522488e97c9160c5/docs/gallery/general/extensions.py#L404C13-L404C18

However, I don't find 'uint' as a valid type in the documentation for the schema language: https://schema-language.readthedocs.io/en/latest/description.html#dtype

Do you have any interest in helping write or edit the documentation?

No.

Code of Conduct

oruebel commented 2 weeks ago

Thanks for reporting this issue. It looks like in the HDF5 backend, uint is being mapped to uint32 (similar to how int is mapped to int32) here:

https://github.com/hdmf-dev/hdmf/blob/d378dec53c3be69cbd03695960e2478cd1f1f455/src/hdmf/backends/hdf5/h5tools.py#L904

However, looking at hdmf-zarr it seems it is missing the mapping for uint:

https://github.com/hdmf-dev/hdmf-zarr/blob/82c993c5177c31480210c7d0982700760dea8cbf/src/hdmf_zarr/backend.py#L1135-L1164

I think there are two options:

  1. Update the schema language docs to include uint as uint32 and also update hdfm-zarr to define it
  2. Change the extension tutorial to using uint32 instead of uint
  3. Do both 1 and 2

Personally, I'm leaning towards option 1 because it seems more consistent with how int is defined. Option 3 is fine too. @rly toughts?

bendichter commented 1 week ago

@oruebel MatNWB does not know how to handle "uint", so this is blocking any extensions that use that data type to be readable in MatNWB