Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Numpy v2 #149

Open
mrava87 opened this issue Jul 26, 2024 · 1 comment
Open

Numpy v2 #149

mrava87 opened this issue Jul 26, 2024 · 1 comment

Comments

@mrava87
Copy link

mrava87 commented Jul 26, 2024

@xir4n, any plan to update the library to support numpy v2.

It seems like dtcwt/numpy/transform1d.py uses asfarray which has been removed - see below

File "/home/docs/checkouts/readthedocs.org/user_builds/pylops/envs/586/lib/python3.9/site-packages/dtcwt/numpy/transform1d.py", line 51, in forward
X = asfarray(X)
File "/home/docs/checkouts/readthedocs.org/user_builds/pylops/envs/586/lib/python3.9/site-packages/dtcwt/utils.py", line 105, in asfarray
return np.asfarray(X, dtype=X.dtype)
File "/home/docs/checkouts/readthedocs.org/user_builds/pylops/envs/586/lib/python3.9/site-packages/numpy/init.py", line 397, in getattr
raise AttributeError(
AttributeError: np.asfarray was removed in the NumPy 2.0 release. Use np.asarray with a proper dtype instead.

@lostanlen
Copy link

Hello @mrava87 , thank you for raising this issue. Indeed it would be good to support NumPy v2 but unfortunately after reading the utils code i don't understand if it's safe to remove the X = asfarray(X) call. Also how are we going to be able to support both Numpy 1.* and 2 ? Should i create a conditional branch on np.__version__ ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants