-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
MAINT: simplify complex math function handling in npymath #22161
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
Conversation
We have our own function declarations in |
this needs a rebase now that gh-22090 is merged |
a569eb7
to
c6366c1
Compare
Tried to fix the issue with the mandatory functions by creating the header. That is slightly annoying, since MSVC does not have proper complex support, so the header has to define the complex type. gh-5687 may mean we have to put the |
It's probably a pragmatic choice to add all those complex functions to a single file. It does couple them together though. I'll note that I implemented this as separate checks for Meson already: https://github.com/numpy/numpy/compare/main...rgommers:numpy:meson?expand=1#diff-1b8787c0de2167aaf65f45eadb93cec2810f91b92c42e422b1e8d07bc152a92fR65-R79 |
64b4397
to
05e213e
Compare
@@ -102,12 +102,14 @@ def set_sig(sig): | |||
args = args.rpartition(")")[0] | |||
funcname = prefix.rpartition(" ")[-1] | |||
args = [arg.strip() for arg in args.split(",")] | |||
FUNC_CALL_ARGS[funcname] = ", ".join("(%s) 0" % arg for arg in args) | |||
# We use {0} because 0 alone cannot be cast to complex on MSVC in C: | |||
FUNC_CALL_ARGS[funcname] = ", ".join("(%s){0}" % arg for arg in args) |
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.
Lets see if this works. I had to add the struct here because (_Dcomplex)0
is not a valid cast in MSVC complex.h
...
@rgommers should we just roll with this? The deletion seems nice (whether we need to roll back or not eventually). |
xref #20880 |
Continuation of #22090: now for complex functions