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

Adapt to NumPy 2.0.0 #176

Open
UnaiSan opened this issue Jun 18, 2024 · 1 comment
Open

Adapt to NumPy 2.0.0 #176

UnaiSan opened this issue Jun 18, 2024 · 1 comment

Comments

@UnaiSan
Copy link

UnaiSan commented Jun 18, 2024

NumPy 2.0.0 has been released and splipy is not working well with it yet.

Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct  2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import splipy

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 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 "<stdin>", line 1, in <module>
  File "C:\Users\SanMiguelU\Documents\python\temp\.venv_np2\Lib\site-packages\splipy\__init__.py", line 1, in <module>
    from .basis import BSplineBasis
  File "C:\Users\SanMiguelU\Documents\python\temp\.venv_np2\Lib\site-packages\splipy\basis.py", line 10, in <module>
    from . import basis_eval, state
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\SanMiguelU\Documents\python\temp\.venv_np2\Lib\site-packages\splipy\__init__.py", line 1, in <module>
    from .basis import BSplineBasis
  File "C:\Users\SanMiguelU\Documents\python\temp\.venv_np2\Lib\site-packages\splipy\basis.py", line 10, in <module>
    from . import basis_eval, state
  File "splipy\\basis_eval.pyx", line 1, in init splipy.basis_eval
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disable if you are certain you don't need it).

I am going to specify numpy<2 in my code(s), but it would be nice if splipy was adapted.

@TheBB
Copy link
Member

TheBB commented Jun 18, 2024

Thanks, I'll have a look at this and build a new version.

In fact I was a bit surprised you were even able to install Splipy together with Numpy 2 because our dependency is explicitly <2, but it seems the last Splipy release was made before that change, so it hasn't made its way to PyPI yet.

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

2 participants