Skip to content

Changes to support NumPy 2.0 #100

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 8 commits into from
May 27, 2024
Merged

Changes to support NumPy 2.0 #100

merged 8 commits into from
May 27, 2024

Conversation

oleksandr-pavlyk
Copy link
Contributor

Changes to support NumPy 2.0

Use np.lib.NumpyVersion to account for change in namespace of some functions. Replaced import from numpy.core with import from numpy main namespace, where appropriate.

Replace np.longcomplex with np.clongdouble.

Fixed import of NumPy C-API in _pydfti extension. This follows https://numpy.org/devdocs/reference/c-api/array.html#including-and-importing-the-c-api

Separate translation units, like mklfft.c, need to include arrayobject.h after defining NO_IMPORT_ARRAY preprocessor variable. The extension must be compiled with PY_ARRAY_UNIQUE_SYMBOL set to artibrary value, but same for all translation units.

Use np.lib.NumpyVersion to account for change in namespace
of some functions. Replaced import from numpy.core with import
from numpy main namespace, where appropriate.

Replace np.longcomplex with np.clongdouble.

Fixed import of NumPy C-API in _pydfti extension. This
follows https://numpy.org/devdocs/reference/c-api/array.html#including-and-importing-the-c-api

Separate translation units, like mklfft.c, need to include arrayobject.h
after defining NO_IMPORT_ARRAY preprocessor variable. The extension must be
compiled with PY_ARRAY_UNIQUE_SYMBOL set to artibrary value, but same for all
translation units.
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the support-numpy-2 branch 5 times, most recently from b18ee3f to 48d716b Compare May 25, 2024 16:01
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the support-numpy-2 branch 8 times, most recently from b8e6795 to 7d6eacb Compare May 26, 2024 19:48
@oleksandr-pavlyk
Copy link
Contributor Author

Thanks @antonwolfy , I have applied suggested hanges

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

I have no more comments. LGTM!

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 0cd520e into master May 27, 2024
16 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the support-numpy-2 branch May 27, 2024 22:23
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.

3 participants