Skip to content
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

BUG: adapt cython files to new complex declarations (#26080) #26109

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

charris
Copy link
Member

@charris charris commented Mar 22, 2024

Backport of #26080.

Fixes #26029

  • declare npy_cfloat and friends as empty structs
  • declare cfloat_t and friends as ctypedef float complex cfloat_t, without being directly connected to npy_cfloat. This allows still using .imag and .real attributes, which Cython wraps with macros
  • add a test for BUG: changing the complex struct has implications for Cython #26029, it passes since we use C compilation for cython. The inplace += will fail on C++.
  • resync the two cython pxd files. At what point do we declare NumPy requires Cython3?

I checked that scipy and cython can use the pxd file.

Edit: I checked on linux, I did not check MSVC

Fixes numpy#26029

declare npy_cfloat and friends as empty structs
declare cfloat_t and friends as ctypedef float complex cfloat_t, without being directly connected to npy_cfloat. This allows still using .imag and .real attributes, which Cython wraps with macros
add a test for BUG: changing the complex struct has implications for Cython numpy#26029, it passes since we use C compilation for cython. The inplace += will fail on C++.
resync the two cython pxd files. At what point do we declare NumPy requires Cython3?
I checked that scipy and cython can use the pxd file.

---------

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Mar 22, 2024
@charris charris added this to the 2.0.0 release milestone Mar 22, 2024
@charris charris merged commit c016810 into numpy:maintenance/2.0.x Mar 22, 2024
61 checks passed
@charris charris deleted the backport-26080 branch March 22, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 08 - Backport Used to tag backport PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants