-
Notifications
You must be signed in to change notification settings - Fork 621
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
Add support for numpy 2 #2421
Add support for numpy 2 #2421
Conversation
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.
Woot for starting to get things ready for numpy 2. Did a quick review of the changes so far. Most look good.
Numpy is maintaining a list of project versions that support numpy 2 -- numpy/numpy#26191. They're waiting of downstream packages to be ready before release. We could add ourselves there if we liked. |
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.
Numpy 2.0 is scheduled to be released June 16th (see numpy/numpy#24300 (comment))
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Description
Add support for the up comming numpy v2:
I did not update the requirement yet, it must be installed in
--no-build-isolation
.When it's officially released, we will need to update
pyproject.toml
andsetup.cfg
, and possibly add test for np2 on windows and mac.Here are the changes that affect us:
np.array(.., copy=False)
no longer mean copy only if needed.copy=None
was added for that.np.trapz
was replaced bynp.trapezoid
. Since there are no overlaps, I opted to usescipy.integrate.trapezoid
instead.np.array(1, np.int32) * 2**33
will enforce the integer type and overflow.Py_intptr_t
frompython.h
is no longer available through numpy cython interface.