Skip to content

Add asynchronous load method #10327

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

Open
wants to merge 84 commits into
base: main
Choose a base branch
from
Open

Conversation

TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented May 16, 2025

Adds an .async_load() method to Variable, which works by plumbing async get_duck_array all the way down until it finally gets to the async methods zarr v3 exposes.

Needs a lot of refactoring before it could be merged, but it works.

API:

  • Variable.load_async
  • DataArray.load_async
  • Dataset.load_async
  • DataTree.load_async
  • load_dataset?
  • load_dataarray?

@TomNicholas
Copy link
Member Author

TomNicholas commented May 30, 2025

Notes to self:

  • Try to consolidate indexing tests with those in test_variable.py, potentially by defining a subclass of Variable that only implements async methods
  • Use create_test_data, write to a zarr (memory)store, and open lazily - this will help test decoding machinery.
  • Raise informative error if you try to do o/v-indexing with a version of zarr that's too old? Or just fall back to blocking in that case...

@TomNicholas TomNicholas marked this pull request as ready for review July 30, 2025 18:18
@TomNicholas
Copy link
Member Author

The changes needed in zarr-python have just been merged upstream (but not yet released).

@TomNicholas TomNicholas added the run-upstream Run upstream CI label Jul 30, 2025
@TomNicholas
Copy link
Member Author

Upstream-dev tests are passing. But they all need to pass otherwise these new methods will error on zarr-python<=3.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration tools dependencies Pull requests that update a dependency file enhancement io run-upstream Run upstream CI topic-backends topic-indexing topic-NamedArray Lightweight version of Variable topic-zarr Related to zarr storage library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an asynchronous load method?
4 participants