feat: adding support for numpy.real, imag, round, angle, #3053
Conversation
These need unit tests still.
Fixing bugs in TypeTracer.angle. Simplifying test_complex_ops. Adding tests of TypeTracer real, imag, angle.
|
Are there automatic code formatters and formatting checks? I guess I'll find out! Oh, I did find out and there are indeed. |
Indeed, they are. You can run |
|
We don't yet have automatic code formatting on C++, but I agree with @ianna that it's more convenient to run pre-commit locally, since formatting changes can automatically write new commits to the PR, and then if you commit on your local clone, you've got a conflict to manage. |
jpivarski
left a comment
There was a problem hiding this comment.
This implements real, imag, angle, and round as NEP-18 overloads, since they're not ufuncs like np.floor:
>>> np.real
<function real at 0x70646be60d70>
>>> np.imag
<function imag at 0x70646be613f0>
>>> np.angle
<function angle at 0x7063e9b4ac30>
>>> np.round
<function round at 0x70646bfd3eb0>
>>> np.floor
<ufunc 'floor'>Overall, it looks good; I just have a few inline requested changes.
As per Jim's recommendation, for real, imag, angle.
|
Let me know when you want me to re-review this! |
|
Great, thanks! This one is done and I'll merge it. |
…e-an-awkward-array-as-input
|
@all-contributors please add @tcawlfield for code |
|
I've put up a pull request to add @tcawlfield! 🎉 |
Closes #2917
This issue does not mention round explicitly. and it does mention around which I have not duplicated yet.
I could additionally implement
numpy.fixandreal_if_close.There is an error in my attempt to support the
out=<array>optional argument -- see discussion.