Repository navigation
BUG: support numpy's unwrap ufunc - #20132
neutrinoceros merged 2 commits into
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
c17d791 to
fd94ee2
Compare
|
Nightlies are not caught up yet. Pending. |
fd94ee2 to
f469498
Compare
f469498 to
57b1ed3
Compare
57b1ed3 to
c894804
Compare
mhvk
left a comment
There was a problem hiding this comment.
Sadly, I think this needs a new helper! I think with this, though, the override of unwrap itself can be removed.
| invariant_ufuncs += (np_umath.imag, np_umath.real) | ||
|
|
||
| if not NUMPY_LT_2_6: | ||
| invariant_ufuncs += (np._core.umath._unwrap,) |
There was a problem hiding this comment.
I don't think _unwrap would be invariant if called directly - discont and period need to be converted to the unit of p.
There was a problem hiding this comment.
of course, what was I thinking... what's surprising to me though is that unwrap is already supported as a NEP-18 array function. I'll dig this further down.
|
@mhvk by "override", do you mean the existing |
|
@neutrinoceros - yes, I think if we support the new |
|
FWIW I see the ufunc failure in devdeps now, so would be nice if we can wrap this up for merging. Thanks, all! |
|
I'll wrap this up tomorrow |
|
I found a single precedent for this situation (a new ufunc) however, I'm still not confident in my fix:
|
28cc116 to
dee5e5c
Compare
my test was definitely incorrect. I removed it for now. Of course I'm even less confident in the patch now 😅 |
|
The devdeps is green (I guess it ran before #20164 happened), so do we proceed despite the decrease in confidence or are we pursuing an alternative fix? Hope you can advise. Thanks! |
|
It's green but the helper isn't covered. I'd like to get feedback from @mhvk before moving forward with this. |
|
@nstarman also would need to re-review because he, too, requested changes. Thanks, all! |
|
I'm having a look... |
dee5e5c to
fbe3c45
Compare
|
OK, I added the code to properly support the ufunc. Unfortunately, actually letting Anyway, bottom line, we now support a |
mhvk
left a comment
There was a problem hiding this comment.
Now a bit too much of an auto-approve, but at least that removes my request changes...
|
Thanks a lot Marten ! I would self-approve too if authors were allowed to. |
This comment was marked as resolved.
This comment was marked as resolved.
|
Looks like for v7.2.x, we either have to |
…132-on-v8.0.x Backport PR #20132 on branch v8.0.x (BUG: support numpy's unwrap ufunc)
Co-authored-by: Marten H. van Kerkwijk <[email protected]> (cherry picked from commit 55da6b4)
Description
xref numpy/numpy#31848