Skip to content

ZarrParser get_metadata fails for LocalStore Zarr with dtype uint8 #811

@eternity8

Description

@eternity8

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:

fill_value = ZARR_DEFAULT_FILL_VALUE[zarr_array.metadata.fill_value.dtype.kind]

The default fill values are hardcoded as a dictionary:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions