Repository navigation
fix: index GCXS arrays pointwise with several index arrays - #985
Merged
hameerabbasi merged 1 commit intoOct 9, 2026
Merged
Conversation
Contributor
Author
|
codecov/project fails on every PR (target 100%; codecov/patch passes here), and the benchmarks job fails on main too ( |
hameerabbasi
approved these changes
Oct 9, 2026
4 of 10 tasks
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.
What type of PR is this? (check all applicable)
Related issues
Checklist
Please explain your changes below.
With more than one index array, GCXS returns the Cartesian product of the indices instead of selecting elements pointwise like NumPy and COO do:
The compressed selection in
getitembuilds the result shape from every index array separately (one axis each), which is outer indexing. Keys with two or more index arrays now go through COO indexing, which already implements NumPy's rules, and the result is converted back to GCXS. Keys with at most one index array take the same path as before, so their performance is unchanged. If you would rather have a native path for this case too, I can look into it; it needs a per-point search of the compressed rows instead of the current row/column product.Tests: added several multi-array keys to
test_advanced_indexingintest_compressed.py(all compressed axes). 30 of the new cases fail on main and all pass here.test_compressed.py,test_compressed_2d.pyandtest_compressed_slicing.pypass (1739 passed), and pre-commit (ruff check/format) is clean. Keys where an integer and an array are separated by a slice still follow COO's current axis order, which #984 changes to match NumPy.