-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Replace npy complex structs with native complex types #24085
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
The I don't know if this will cause problems or not, the complex types were late to arrive in C and there might be some compatibility problems. |
Thanks a lot for the pointers! Unfortunately, the generated files will need to change, since
Yeah, this has been mostly about checking whether everything would work fine. I guess there's no better way than to do the work. |
30b3af7
to
ad60798
Compare
5c5d5f7
to
bf3fa21
Compare
d9bfd27
to
717141f
Compare
You hit the nail on the head. MSVC made this PR so much harder than it should have been. |
Yeah, but unlike C99 support, I think the C++ |
It does exist, but it makes using these types more complicated, since |
CI failures appear to be unrelated, so, someone, please restart the two failing jobs. 🙏 |
Failures were down to one, and I restarted that last one now. If it fails again, please simply ignore it. |
Thanks @lysnikolaou |
A few follow-ups we might want to look into:
Is there anything else to think about? |
I can do this in a new PR, if that's okay. It'll be my first time writing anything more than a one-liner for a release note though, so it's okay if someone else wants to take this.
Agreed that it's okay to leave as-is for now. Cython's handling of complex's is a bit complicated as well because of the MSVC issues, so it might make things harder to reason about.
We could write a few words in the NumPy core math library section of the docs about complex handling as well, although I guess that wouldn't be a priority. Also, I'm already working on removing as much of the complex compat layer in |
Fixes breakage with numpy's main branch after numpy/numpy#24085
Sounds like a good exercise to me:) Describing the reason for the change and how to adapt to it is the main thing, which I think is easiest for you to do. We can help tweak so it fits with the other release notes if needed. Given that this is causing a fair amount of breakage (at least SciPy, pandas, and h5py I've seen), it'd be nice to get this drafted. |
Sounds good! I'll get started on this tomorrow. |
#ifdef __cplusplus | ||
} | ||
#endif | ||
#undef complex |
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.
I don't think this #undef
should be here. This breaks the use of complex
in extensions modules that use #include <complex.h>
that also include this NumPy header.
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.
xref #24343
See discussion in #20880.