Add xarray.open_zarr_async() - #11580
Open
davidbrochart wants to merge 4 commits into
Open
Conversation
Contributor
Author
|
What do you think @shoyer ? |
Member
|
To me, a name like Instead, it might make sense to expose an option to disable running the event loop in a separate thread inside |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
It looks like Zarr has an async API for opening a store, but xarray doesn't. There is only the sync
open_zarr(), which calls the sync Zarr API which runs the async API in an event loop in a separate thread. I understand that this is not in the critical path (it's metadata), but that prevents using xarray in WASM Python, since threads are not supported there.Checklist
whats-new.rstapi.rstAI Disclosure
I have tested any AI-generated content in my PR.
I take responsibility for any AI-generated content in my PR.
Tools: Codex
Prompt: "it looks like xarray's
open_zarris a synchronous function that eventually calls zarr's sync API that runs the async API in an event loop in a separate thread, so that won't work for WASM python where threads are not supported. is there a way to open a zarr store asynchronously in xarray? if not, could you make changes that add the async equivalent toopen_zarr?"