-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Zarr loading from ZipStore gives error on default arguments #2586
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
Comments
@eeopd - thanks for opening this issue. This seems like a reasonable request though I'm wondering if this is actually more a zarr problem than an xarray one. I say that because xarray's zarr backend doesn't modify the group kwarg at all, it just passes it though to |
I'm not really familiar with XArray's internals, but issue ( #2660 ) looks relevant. What happens if you do? ds.to_zarr(zarr.group(zarr.ZipStore("test.zarr")))
print(xr.open_zarr(zarr.group(zarr.ZipStore("test.zarr")))) |
Hmm, I can't reproduce my issue anymore, it now works by default. I have no idea what fixed it. I suppose that means this issue can be closed :) @jakirkham, your suggestion does not work: ds.to_zarr only seems to accept zarr datastores or a path (in that case the data is stored in a zarr.DirectoryStore)
|
IMO, zarr needs some kind of "resolver" mechanism that takes a string and decides what kind of store it represents. For example, if the path ends with |
Some very limited support for this is there already, e.g., if string ends with '.zip' then a zip store will be used, but there's no support for dispatching to cloud stores via a URL-like protocol. There's an open issue for that: zarr-developers/zarr-python#214 |
(This is not too much of a problem, but it would probably be a reasonably easy fix)
This gives the following error:
Instead, one has to use
When using a dictionary as store (e.g. when using
ds.to_zarr('test_zarr')
), thisgroup='/'
is unnecessary when loading it again, but everything still works when using it anyway. So I'd propose changing the default value of the group argument to'/'
, so the ZipStore (and probably also the other stores) will work by default as well.The text was updated successfully, but these errors were encountered: