You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has there been consideration of defining an optional base class in Zarr for storage objects?
The main use cases would be to support type inference. For example, it would be nice if xarray.open_dataset(zarr_store) could work automatically, but this requires some way to infer that zarr_store is a Zarr store as opposed to another file-type supported by xarray. My current proposal is to check for the presence of a '.zgroup' key in a mutable mapping. It would be more elegant/faster to just be able to to use isinstance(store, zarr.storage.Store).
I know that in principle any object implementing the MutableMapping interface suffices for storing data in Zarr, but in practice I suspect that most storage objects include least a small layer written explicitly for Zarr, e.g., to implement special methods like listdir and rmdir. You could still support arbitrary Mapping objects when explicitly passed into zarr.open(), etc (in xarray, this would happen if engine='zarr' passed into open_dataset).
The text was updated successfully, but these errors were encountered:
Has there been consideration of defining an optional base class in Zarr for storage objects?
The main use cases would be to support type inference. For example, it would be nice if
xarray.open_dataset(zarr_store)
could work automatically, but this requires some way to infer thatzarr_store
is a Zarr store as opposed to another file-type supported by xarray. My current proposal is to check for the presence of a'.zgroup'
key in a mutable mapping. It would be more elegant/faster to just be able to to useisinstance(store, zarr.storage.Store)
.I know that in principle any object implementing the
MutableMapping
interface suffices for storing data in Zarr, but in practice I suspect that most storage objects include least a small layer written explicitly for Zarr, e.g., to implement special methods likelistdir
andrmdir
. You could still support arbitraryMapping
objects when explicitly passed intozarr.open()
, etc (in xarray, this would happen ifengine='zarr'
passed intoopen_dataset
).The text was updated successfully, but these errors were encountered: