Skip to content

MAINT: special: remove one libnpymath dependency; more NPY_ -> C99 #16816

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

Merged
merged 2 commits into from
Aug 14, 2022

Conversation

rgommers
Copy link
Member

Replacements:

  • NPY_NAN -> NAN
  • NPY_INFINITY -> INFINITY
  • NPY_PI -> M_PI
  • NPY_E -> M_E
  • npy_isnan -> isnan
  • npy_isinf -> isinf
  • npy_isfinite -> isfinite
  • npy_copysign -> copysign
  • npy_signbit -> signbit

Also cleans up a lot of Cython imports, and removes one libnpymath inclusion. That removal reduces binary size and works towards not depending on libnpymath at all - see numpy/numpy#20880.

Things brings us down to 13 places where we still include numpy/npy_math.h.

…9 changes

Replacements:
- `NPY_NAN` -> `NAN`
- `NPY_INFINITY` -> `INFINITY`
- `NPY_PI` -> `M_PI`
- `NPY_E` -> `M_E`
- `npy_isnan` -> `isnan`
- `npy_isinf` -> `isinf`
- `npy_isfinite` -> `isfinite`
- `npy_copysign` -> `copysign`
- `npy_signbit` -> `signbit`

Also cleans up a lot of Cython imports, and removes one `libnpymath`
inclusion. That removal reduces binary size and works towards not
depending on `libnpymath` at all - see numpy/numpy#20880
@rgommers rgommers added scipy.special maintenance Items related to regular maintenance tasks labels Aug 10, 2022
@rgommers rgommers requested a review from person142 as a code owner August 10, 2022 09:21
Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick pass, but looks like a great clean-up!

@rgommers rgommers added this to the 1.10.0 milestone Aug 10, 2022
@rgommers
Copy link
Member Author

The one failure (TestSchur.test_sort) is gh-14517, unrelated to this PR. I'll cancel CI for the second commit (please squash-merge that)

Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same below)

There were two more instances...

@ev-br ev-br merged commit ac729b8 into scipy:main Aug 14, 2022
@ev-br
Copy link
Member

ev-br commented Aug 14, 2022

LGTM. Squash-merged as requested to keep the ball rolling, thanks Ralf, all.

@rgommers rgommers deleted the more-numpy2c99 branch August 14, 2022 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.special
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants