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

ENH Support numpy 2 #524

Merged
merged 3 commits into from
Jun 18, 2024
Merged

Conversation

drewejohnson
Copy link
Collaborator

Fixes #515

Uses longdouble over longfloat which was removed in numpy 2.0

Also transition from numpy.core.defchararray to numpy.char for the few string array comparisons we do. Eventually we'll want to use numpy.string to get future updates - https://numpy.org/doc/stable/reference/routines.char.html#module-numpy.char

This submodule (numpy.char) is considered legacy and will no longer receive updates. This could also mean it will be removed in future NumPy versions. The string operations in this module, as well as the numpy.char.chararray class, are planned to be deprecated in the future. Use numpy.strings instead.

Make sure you have read over the developer guide to ease
the review process. These include:

The latter produces the following deprecation warning:

> DeprecationWarning: numpy.core.defchararray is deprecated and has been renamed to
numpy._core.defchararray. The numpy._core namespace contains private NumPy internals
and its use is discouraged, as NumPy internals can change without warning in any
release. In practice, most real-world usage of numpy.core is to access functionality
in the public NumPy API. If that is the case, use the public NumPy API. If not, you
are using NumPy internals. If you would still like to access an internal attribute,
use numpy._core.defchararray.equal.  from numpy.core.defchararray import equal as charEqual

Eventually we should start using `numpy.strings` once we move to
`numpy>=2.0` since `numpy.char` is deprecated and will not receive
updates. From https://numpy.org/doc/stable/reference/routines.char.html#module-numpy.char

>  This submodule is considered legacy and will no longer receive updates. This could
also mean it will be removed in future NumPy versions. The string operations in this
module, as well as the numpy.char.chararray class, are planned to be deprecated in the
future. Use numpy.strings instead
@drewejohnson drewejohnson added this to the 0.11.0 milestone Jun 18, 2024
@drewejohnson drewejohnson requested a review from DanKotlyar June 18, 2024 16:40
@drewejohnson drewejohnson self-assigned this Jun 18, 2024
@DanKotlyar DanKotlyar merged commit 729678a into CORE-GATECH-GROUP:main Jun 18, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG numpy 2.0 removed longfloat
2 participants