-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Draft
TomNicholas
wants to merge
65
commits into
pydata:main
Choose a base branch
from
TomNicholas:async.load
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add asynchronous load method #10327
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
01e7518
new blank whatsnew
TomNicholas 83e553b
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas e44326d
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 4e4eeb0
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas d858059
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas d377780
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 3132f6a
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 900eef5
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 4c4462f
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 5b9b749
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas fadb953
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 57d9d23
Merge branch 'main' of https://github.com/TomNicholas/xarray
TomNicholas 11170fc
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 0b8fa41
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas f769f85
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 4eef318
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 29242a4
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas e6b3b3b
test async load using special zarr LatencyStore
TomNicholas 3ceab60
don't use dask
TomNicholas 071c35a
async all the way down
TomNicholas 29374f9
remove assert False
TomNicholas ab12bb8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 62aa39d
add pytest-asyncio to CI envs
TomNicholas dfe8bf7
Merge branch 'async.load' of https://github.com/TomNicholas/xarray in…
TomNicholas a906dec
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 629ab31
assert results are identical
TomNicholas 7e9ae0f
implement async load for dataarray and dataset
TomNicholas d288351
factor out common logic
TomNicholas e0731a0
consolidate tests via a parametrized fixture
TomNicholas 9b41e78
async_load -> load_async
TomNicholas 67ba26a
make BackendArray an ABC
TomNicholas 9344e2e
explain how to add async support for any backend in the docs
TomNicholas f8f8563
add new methods to api docs
TomNicholas 30ce9be
whatsnew
TomNicholas 5d15bbd
Merge branch 'main' of https://github.com/pydata/xarray
TomNicholas 1f02de1
Merge branch 'main' into async.load
TomNicholas 2342b50
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b6d4a82
Fix ci/minimum_versions.py
TomNicholas 2079d7e
fix formatting
TomNicholas 48e4534
concurrently load different variables in ds.load_async using asyncio.…
TomNicholas cca7589
test concurrent loading of multiple variables in one dataset
TomNicholas dfe9b87
fix non-awaited load_async
TomNicholas 84099f3
rearrange test order
TomNicholas ab000c8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a8b7b46
add test for orthogonal indexing
TomNicholas 82c7654
explicitly forbid orthogonal indexing
TomNicholas 5eacdb0
support async orthogonal indexing via https://github.com/zarr-develop…
TomNicholas 9f33c09
Merge branch 'async.load' of https://github.com/TomNicholas/xarray in…
TomNicholas 093bf50
add test for vectorized indexing (even if it doesn't work)
TomNicholas 4073a24
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 842a06c
add test for basic indexing
TomNicholas e19ab55
correct test to actually use vectorized indexing
TomNicholas b9e8e06
refactor to parametrize indexing test
TomNicholas 8bc7bea
implement async vectorized indexing
TomNicholas 6c47e3f
revert breaking change to BackendArray
TomNicholas a86f646
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 884ce13
remove indirection in _ensure_cached method
TomNicholas a43af86
IndexingAdapters don't need async get
dcherian 17d7a0e
Add tests
dcherian d824a2d
Add decoding test
dcherian 6a13611
Add IndexingAdapter mixin
dcherian d79ed54
[cherry] Making decoding arrays lazy too
dcherian 1da3359
parametrized over isel and sel
TomNicholas dded9e0
mock zarr.AsyncArray.getitem in test
TomNicholas 4c347ad
tidy up the mocking
TomNicholas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
"coveralls", | ||
"pip", | ||
"pytest", | ||
"pytest-asyncio", | ||
"pytest-cov", | ||
"pytest-env", | ||
"pytest-mypy-plugins", | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented this for the
ZarrArray
class but in theory it could be supported by other backends too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be the desired behaviour though - this currently means if you opened a dataset from netCDF and called
ds.load_async
you would get aNotImplementedError
. Would it be better to quietly just block instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes absolutely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I can do that. But can you explain why you feel that this would be better behaviour? Asking for something to be done async and it quietly blocking also seems not great...