-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NetCDF files with many empty variables require large drop_variables
declaration
#194
Comments
By "non-array" you mean scalar right? This is definitely an edge case I haven't thought through in great detail. I think the main question is whether one can have valid Zarr arrays with a chunk shape of (). If not then we might want to automatically load these variables instead, i.e. add them to |
I think so? I'm not sure how to translate between the NetCDF concept and a Zarr array, I think ultimately Zarr only deals in Arrays or Groups. Scalar is a good word for it though.
You can in zarrv2. This is allowed: import zarr
store = zarr.open("example.zarr", mode="w", shape=(), chunks=(), path="a")
store.attrs["important attribute"] = 42 Which results in this store:
BUT This is not allowed in ZarrV3:
Maybe it will be fixed? zarr-developers/zarr-python#1977 Setting these as Should VirtualiZarr automatically load scalar variables? I think it's a nice feature for users and it would make it unnecessary to add a long list of variables to the |
I'm not sure if this is a real issue or working as intended, but I wanted to get clarification on it. The GOES dataset's NetCDF files contain many non-array variables such that the call to
virtualizarr.open_virtual_dataset
needs a large number ofdrop_variables
to work. All of the dropped variables have in common achunk_shape
of()
, because they're not arrays.If
validate_chunk_shape
skipped validating empty dicts, it would be possible to open this dataset without having to pass such adrop_variables
list, but more importantly we could preserve variable metadata when we write a Zarr store for this file and others. Is there a reason VirtualiZarr shouldn't read empty variables like this?Repro
The text was updated successfully, but these errors were encountered: