There is some code in from_kerchunk_refs which creates a ZArray with fill_val = np.nan as the default value which does not match the default value set in the ZArray constructor. Here are the lines where the issue occurs. This creates a mismatch between the virtual datasets produced by kerchunk and non-kerchunk readers (dmrpp and hdf).
Here is an example:
from virtualizarr.zarr import ZArray
import numpy as np
z = {"shape": (2, 3), "dtype": np.dtype("float32"), "chunks": (2, 3), "compressor": None, "filters": None, "fill_value": None, "order": "C", "zarr_format": 2}
print(ZArray(**z))
print(ZArray.from_kerchunk_refs(z))
Original comment: https://github.com/zarr-developers/VirtualiZarr/pull/265#issuecomment-2456072544
There is some code in
from_kerchunk_refs
which creates a ZArray withfill_val = np.nan
as the default value which does not match the default value set in the ZArray constructor. Here are the lines where the issue occurs. This creates a mismatch between the virtual datasets produced by kerchunk and non-kerchunk readers (dmrpp
andhdf
).Here is an example: