-
Notifications
You must be signed in to change notification settings - Fork 15
ENH: at
: add __setitem__
fancy indexing fallback
#395
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
base: main
Are you sure you want to change the base?
Conversation
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.
thanks @amacati !
__setitem__
fancy indexing fallback
__setitem__
fancy indexing fallbackat
: add __setitem__
fancy indexing fallback
The fallback is now implemented as error handling for One remaining concern is out-of-bounds indices. For anything negative or positive |
Seems fine to leave that for now. I guess the pattern would be to hide things behind |
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.
looks good to me, thanks @amacati !
Would you like to take a look @crusaderky ?
the codecov failure is not a worry |
lint failures are real but trivial |
I'll release 0.8.1 soon, and merge this for 0.9.0 by the end of the week if there is no further feedback |
Fancy indexing is currently not supported for
__setitem__
, which blocks some PRs in scipy (scipy/scipy#23425).As discussed in data-apis/array-api#864 (comment), all frameworks of the array api already implement this feature, but not necessarily in a consistent manner for duplicate indices. It is currently not part of the standard. This PR adds a workaround for array api strict to allow fancy indexing in
xpx.at(x, ...)
.