-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: adding support for numpy.real, imag, round, angle, #3053
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. |
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.
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.fix
andreal_if_close
.There is an error in my attempt to support the
out=<array>
optional argument -- see discussion.