Skip to content
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

Allow non-string specification of stores #390

Closed
rabernat opened this issue Feb 20, 2024 · 2 comments · Fixed by #391
Closed

Allow non-string specification of stores #390

rabernat opened this issue Feb 20, 2024 · 2 comments · Fixed by #391

Comments

@rabernat
Copy link

For compatibility with Arraylake, we would want to expand this type

T_Store = str # TODO: expand this

to allow passing a Zarr Store object (rather than a string), plus optionally a group argument.

We would probably like to call to_zarr like this

from arraylake import Client
client = Client()
repo = client.get_repo("earthmover/foo")

to_zarr(x, store=repo.store, group="sub/group")

The repo.store object is serializable.

@tomwhite
Copy link
Member

Thanks for opening the issue @rabernat.

we would want to expand this type

I'm not sure what the best type signature is here, so probably Any?

I've opened #391 to allow a group argument (in from_zarr too), which should support your use case. I've called it path as that is what Zarr seems to call it, but I notice Dask calls it component. Any thoughts about naming?

@rabernat
Copy link
Author

I'm not sure what the best type signature is here, so probably Any?

It would be one of the base types from Zarr, e.g. https://github.com/zarr-developers/zarr-python/blob/f80f697c2612cf41c5bdb158a602c1ae8a737e70/zarr/_storage/store.py#L164

(However, these are going to evolve soon with the Zarr V3 refactor.)

I've called it path as that is what Zarr seems to call it, but I notice Dask calls it component

To make it even more fun, Xarray calls it group! 🙃 path is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants