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: PyArray_MAX
no longer available in numpy/arrayobject.h
#18966
Comments
Can you comment on why this change and not importing PyArray_MAX from npy_math.h, where the linked numpy PR moves them to? |
I have no clue what's best to do 😅 I just followed the bug, C and NumPy's internal are not my expertise. I am happy to try to do the change you are suggesting instead. And seems like CI does not like what I did hum. So I would need to do |
But if we use |
These includes might need to be guarded by an #ifdef depending on the numpy version? Let's ask @lysnikolaou for a recommended way of working around the numpy change. |
Or maybe it's easiest to just copy-paste the macros in their full complexity and not depend on numpy for them:
|
Let's ask yes 👍 For now locally I got it working with: out = (PyArrayObject*)PyArray_Max(a, b, NULL);
out = (PyArrayObject*)PyArray_Min(a, b, NULL); I updated the PR. |
I'm not an expert really, and with my limited understanding, I don't get why including "numpy/npy_math.h" is backwards-incompatible. If it is, then you can hide it behind an Agreed that it might be best to copy-paste the macros though since they're not overly complex. |
We need to support NumPy >=1.22.4. So I would suppose that new changes in I am happy to move the macros as there are just 2 files where these are used in our code base. |
They won't be backported but my feeling is that if you keep both the old Still better to just move the macros. |
Ah yes i see what you both meant now! See my C level 😅 I will update my PR to just hard code the macro there then, thanks again! |
PyArray_MAX
no longer available in NumPy PyArray_MAX
no longer available in numpy/arrayobject.h
There was a change in NumPy which removes
PyArray_MAX
andPyArray_MIN
. E.g. of issue in our CI https://github.com/scipy/scipy/actions/runs/5663008932/job/15343987040#step:9:2979I believe the PR on NumPy is numpy/numpy#24258
The text was updated successfully, but these errors were encountered: