Commit 9b1d570
Add asynchronous load method (#10327)
* new blank whatsnew
* test async load using special zarr LatencyStore
* don't use dask
* async all the way down
* remove assert False
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add pytest-asyncio to CI envs
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* assert results are identical
* implement async load for dataarray and dataset
* factor out common logic
* consolidate tests via a parametrized fixture
* async_load -> load_async
* make BackendArray an ABC
* explain how to add async support for any backend in the docs
* add new methods to api docs
* whatsnew
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix ci/minimum_versions.py
* fix formatting
* concurrently load different variables in ds.load_async using asyncio.gather
* test concurrent loading of multiple variables in one dataset
* fix non-awaited load_async
* rearrange test order
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add test for orthogonal indexing
* explicitly forbid orthogonal indexing
* support async orthogonal indexing via zarr-developers/zarr-python#3083
* add test for vectorized indexing (even if it doesn't work)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add test for basic indexing
* correct test to actually use vectorized indexing
* refactor to parametrize indexing test
* implement async vectorized indexing
* revert breaking change to BackendArray
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove indirection in _ensure_cached method
* IndexingAdapters don't need async get
* Add tests
* Add decoding test
* Add IndexingAdapter mixin
* [cherry] Making decoding arrays lazy too
* parametrized over isel and sel
* mock zarr.AsyncArray.getitem in test
* tidy up the mocking
* ensure the correct zarr class's method is patched for each test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add degenerate test case of no indexing
* factor out the Latency part of LatencyStore
* use mocks in multiple objects test
* use mocks in multiple variables test
* trim latencystore down to just what's needed to dodge zarr-developers/zarr-python#3105 (comment)
* parametrizing indexing test over xarray classes
* ensure we actually test vectorized indexing for Variable
* use create_test_data
* add @pytest.mark.asyncio
* remove outdated readonly_store
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* enable tests to run when recent version of zarr-python is not available
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* separate tests to only run on correct versions of zarr
* clear error message if async oindexing not available
* parametrize over zarr_format
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add pytest-asyncio to other test CI env
* fix some mypy errors
* use method directly when possible
* remove repeated API docs from bad merge
* fix bad merge in release note
* fix other bad merge in whatsnew
* remove prints
Co-authored-by: Deepak Cherian <[email protected]>
* remove last print statement
* test async basic indexing raises informative error before zarr-python v3.0.0
* test correct error message is raised for each indexing case
* ensure each test runs on the earliest version of xaarr it can
* remove pointless repeated getitem
* set N_LAZY_VARS correctly in test
* remove unused import
* rename flag to make it more clear its only for orthogonal and vectorized indexing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove IndexingAdapter special case
* type fixes
* return a deepcopy
* try again
* one more
* Try again
* try fixing _in_memory error by not returning the adapter class
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove scope=module from fixture for robustness
* modify test to be happy with either error message
* use Variable instead of Dataset to avoid race condition of indexing between different variables
* fix bad merge in API docs
* add test to test_backends.py
* fix bug found by new test, causing pandas indexes to be converted to numpy arrays
* add test to test_variable.py for lazy async indexing
* move async load tests from test_async.py to test_backends.py
* parametrize all tests over zarr_format
* remove test_async.py file entirely
* lint
* Stricter assertions
Co-authored-by: Deepak Cherian <[email protected]>
* Update doc/whats-new.rst
Co-authored-by: Deepak Cherian <[email protected]>
* add docstring for Variable.load_async
* make all load-related docstrings consistent
* note about users being responsible for limiting concurrency
* remove parametrization over zarr_format
* account for Dataset having multiple lazy vars
* refactor test parametrization to use pytest.param(..., id=...) syntax
* refactor TestBackendIndexing to combine sync and async checks in one function
* move test_load_async onto test base class
* should fix mypy error
* add back in the parametrize_zarr_format to avoid trying to write v3 data using zarr-python v2
* parametrize test over async
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Deepak Cherian <[email protected]>
Co-authored-by: Deepak Cherian <[email protected]>1 parent ef180b8 commit 9b1d570
File tree
26 files changed
+803
-110
lines changed- ci
- requirements
- doc
- internals
- xarray
- backends
- coding
- core
- namedarray
- tests
26 files changed
+803
-110
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments