BUG: properly handle negative indexes in ufunc_at fast path #24150
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.
Fixes #24147
When avoiding the iter API for faster iteration, negative indexes need to be unwrapped.
Other places this is done in a similar way:
mapiter_@name@
numpy/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
Lines 1683 to 1684 in c143f7b
PyArray_MapIterReset
numpy/numpy/core/src/multiarray/mapping.c
Lines 2281 to 2282 in c143f7b
PyArray_MapIterNext
numpy/numpy/core/src/multiarray/mapping.c
Lines 2335 to 2336 in c143f7b
Test added that failed before, passes after