-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 indexing unindexed dimensions using dask arrays #5873
Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bc4271c
Attempt to fix indexing for Dask
bzah 73696e9
Works now.
dcherian fad4348
avoid importorskip
dcherian 7dadbf2
More tests and fixes
dcherian b7c382b
Merge branch 'main' into fix/dask_indexing
bzah 46a4b16
Merge branch 'main' into fix/dask_indexing
dcherian ec4d6ee
Raise nicer error when indexing with boolean dask array
dcherian 944dbac
Annotate tests
dcherian fb5b01e
Merge branch 'main' into fix/dask_indexing
bzah 335b5da
edit query tests
dcherian a11be00
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d5e7646
Merge branch 'main' into fix/dask_indexing
dcherian 9cde88d
Fixes #4276
dcherian 8df0c2a
Add xfail notes.
dcherian 9f5e31b
backcompat: vendor np.broadcast_shapes
dcherian 3306329
Small improvement
dcherian 32b73c3
fix: Handle scalars properly.
dcherian d6170ce
fix bad test
dcherian aa1df48
Check computes with setitem
dcherian c93b297
Merge branch 'main' into fix/dask_indexing
dcherian 97fa188
Merge remote-tracking branch 'upstream/main' into fix/dask_indexing
dcherian 3f008c8
Merge branch 'main' into fix/dask_indexing
dcherian ff42585
Better error
dcherian d15c7fe
Cleanup
dcherian 220edc8
Raise nice error with VectorizedIndexer and dask.
dcherian 8445120
Add whats-new
dcherian 75a6299
Merge branch 'main' into fix/dask_indexing
dcherian 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 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 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
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.
How about
with
from . import raise_if_dask_computes
at the top.We could test
9
,[9]
, and[9, 9]
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.
Edited
When the indexer is an independent Dask array, the computation is triggered.
By modifying the unit test as follow, it raises the "RuntimeError: Too many computes. Total: 1 > max: 0"
I thought it would only be triggered when the indexer is constructed from
da
.That's why the unit test was using
idx = da.argmax("time")
.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.
Yeah that
raise_if_dask_computes
decorator is great for checking these ideas.I've got it fixed but we should wait for @benbovy to finish with #5692 (though it doesn't look like that PR conflicts with these changes). It would be useful to add more test cases here.
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.
Some other tests could be the ones in #4276, #4663, and this one from #2511
Which actually does work now, but end up computing the indexer
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.
TBH, I was not expecting these changes to be merged, it was only to support the discussion on the issue but it's nice if can be integrated.
I'll try to add the unit tests.