Repository navigation
fix: move the advanced-index axis to the front for GCXS like NumPy - #990
Open
raashish1601 wants to merge 1 commit into
Open
raashish1601 wants to merge 1 commit into
raashish1601 wants to merge 1 commit into
Conversation
Contributor
Author
|
codecov/project fails on every PR here (codecov/patch passes), and the benchmarks job fails on main too, so neither is from this change. |
7 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.
This is the GCXS follow-up mentioned in #984. When the advanced indices in a key are not next to each other, NumPy puts the axis they produce first. GCXS still keeps it in place, so the shape and values are wrong:
getitemin_compressed/indexing.pynow uses theadvanced_index_axis()helper from #984 and transposes the advanced axis to the front before returning, in both the reshape path for 1-d results and the general path. Keys with several index arrays already go through COO since #985, so they get the COO fix.Tests: added the separated cases to
test_advanced_indexingintest_compressed.py(16 of the new cases fail on main). A comparison with NumPy over ~37,000 keys built fromNone, integers, slices, one list andEllipsison 3-d and 4-d GCXS arrays with differentcompressed_axeshad 3112 mismatches on main and none here.test_compressed.pypasses and ruff check/format is clean.