Repository navigation
ENH: Always produce a consistent shape in the result of argwhere - #13610
Conversation
|
Looking downstream - I suspect the only users actually affected by this will be the ones who have code that is currently broken on 0d arrays anyway. |
mhvk
left a comment
There was a problem hiding this comment.
One small comment about the docstring changes.
But a larger one overall: isn't it really better to just change nonzero? See #13522 (comment)
There was a problem hiding this comment.
Probably good to also mention argwhere in the See also section.
seberg
left a comment
There was a problem hiding this comment.
Lets maybe put this off to 1.18? I like the change, but hope it is not too bold. But then the current 0-D behaviour is pretty broken. Tests also look good. It definitely will need a release note though.
We do have a .. versionchanged:: tag, which I think we should use in the notes Section here.
|
If we're deprecating nonzero for this case, we probably need an implementation here that does not use it. |
Don't think there's any way for me to write release notes if we do that. Opening #13707 to track solutions to that problem. |
7358413 to
9d1b7dd
Compare
|
Updated with a release note |
|
Failing: |
9d1b7dd to
586e3a2
Compare
|
Yep, caught out by a rebase. Had to tweak the imports some more to avoid cycles. |
|
Builds are failing: |
Previously this would return 1d indices even though the array is zero-d. Note that using atleast1d inside numeric required an import change to avoid a circular import.
586e3a2 to
b6a3ee3
Compare
|
Looks all good to me. Lets give it a shot for 1.18. The quest for making 0D arrays not weird continues :). |
Previously this would return 1d indices even though the array is zero-d.
Also update the docs to remove recommending the use of
tranpose(nonzero(a)).Inspired by #13522 - we can't easily fix
nonzero, but we can fix downstream uses.