-
Notifications
You must be signed in to change notification settings - Fork 54
Description
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:
VirtualiZarr/virtualizarr/parsers/zarr.py
Line 82 in a2b65c1
| fill_value = ZARR_DEFAULT_FILL_VALUE[zarr_array.metadata.fill_value.dtype.kind] |
The default fill values are hardcoded as a dictionary:
VirtualiZarr/virtualizarr/parsers/zarr.py
Lines 25 to 33 in a2b65c1
| ZARR_DEFAULT_FILL_VALUE: dict[str, FillValueT] = { | |
| # numpy dtypes's hierarchy lets us avoid checking for all the widths | |
| # https://numpy.org/doc/stable/reference/arrays.scalars.html | |
| np.dtype("bool").kind: False, | |
| np.dtype("int").kind: 0, | |
| np.dtype("float").kind: 0.0, | |
| np.dtype("complex").kind: [0.0, 0.0], | |
| np.dtype("datetime64").kind: 0, | |
| } |
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?