VirtualiZarr icon indicating copy to clipboard operation
VirtualiZarr copied to clipboard

ZarrParser get_metadata fails for LocalStore Zarr with dtype uint8

Open eternity8 opened this issue 3 months ago • 1 comments

I am new to VirtualiZarr, tried loading a Zarr file from my local machine as a virtual zarr with the ZarrParser:

data = open_virtual_dataset( url=file_url, parser=ZarrParser("my_file.zarr"), registry=registry )

However, the open operation fails due to one of the columns in the zarr having type uint8.

The failure occurs in the get_metadata function due to a key error on the default fill value lookup: https://github.com/zarr-developers/VirtualiZarr/blob/a2b65c1f48e29c0e51751a29e0b32f09be660bad/virtualizarr/parsers/zarr.py#L82

The default fill values are hardcoded as a dictionary:

https://github.com/zarr-developers/VirtualiZarr/blob/a2b65c1f48e29c0e51751a29e0b32f09be660bad/virtualizarr/parsers/zarr.py#L25-L33 but does not include the 'u' key, (np.dtype("uint8").kind )

Is this a simple fix of adding more keys to the hardcoded default fill value list? Or are unsigned ints unsupported at this stage?

eternity8 avatar Oct 09 '25 05:10 eternity8

Unsigned ints are supposed to be supported! See https://zarr.readthedocs.io/en/stable/user-guide/data_types.html#integral for the list. So this should be a simple fix...

TomNicholas avatar Oct 09 '25 14:10 TomNicholas