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

numpy 2.0+ compatibility #59

Open
dvolgyes opened this issue Jul 27, 2024 · 0 comments
Open

numpy 2.0+ compatibility #59

dvolgyes opened this issue Jul 27, 2024 · 0 comments

Comments

@dvolgyes
Copy link

Hi,

It is a great package, and it would be most helpful if you could rebuild it for numpy 2.0 support.
Currently importing leads to this error message (slightly edited):

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "/home/....py", line 6, in <module>
    import CSF
  File "/home/.../site-packages/CSF.py", line 15, in <module>
    import _CSF
Traceback (most recent call last):
  File "/home/.../site-packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Very likely the only thing you would need to do is compile the code with Numpy 2.0 (and publish it on pypi :) ),
that suppose to be backward compatible. (But I don't completely follow the array magic inside
CSF codes, so maybe there is more.)
https://numpy.org/doc/stable/dev/depending_on_numpy.html#numpy-2-abi-handling

Thanks!

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

No branches or pull requests

1 participant