PyLops / pylops

PyLops – A Linear-Operator Library for Python
https://pylops.readthedocs.io
GNU Lesser General Public License v3.0
426 stars 102 forks source link

Update scipy imports to avoid deprecations #469

Closed cako closed 1 year ago

cako commented 1 year ago

Newer versions of SciPy have changed namestaces. These are some warnings when running scipy >= 1.9.1:

pylops/linearoperator.py:22: DeprecationWarning: Please use `isintlike` from the `scipy.sparse` namespace, the `scipy.sparse.sputils` namespace is deprecated.
    from scipy.sparse.sputils import isintlike, isshape

pylops/linearoperator.py:22: DeprecationWarning: Please use `isshape` from the `scipy.sparse` namespace, the `scipy.sparse.sputils` namespace is deprecated.
    from scipy.sparse.sputils import isintlike, isshape

pylops/basicoperators/vstack.py:7: DeprecationWarning: Please use `LinearOperator` from the `scipy.sparse.linalg` namespace, the `scipy.sparse.linalg.interface` namespace is deprecated.
    from scipy.sparse.linalg.interface import LinearOperator as spLinearOperator

pylops/basicoperators/hstack.py:7: DeprecationWarning: Please use `LinearOperator` from the `scipy.sparse.linalg` namespace, the `scipy.sparse.linalg.interface` namespace is deprecated.
    from scipy.sparse.linalg.interface import LinearOperator as spLinearOperator

pylops/basicoperators/blockdiag.py:7: DeprecationWarning: Please use `LinearOperator` from the `scipy.sparse.linalg` namespace, the `scipy.sparse.linalg.interface` namespace is deprecated.
    from scipy.sparse.linalg.interface import LinearOperator as spLinearOperator
mrava87 commented 1 year ago

Mmh this is annoying, we already have to do some checking about spicy versions in eg vstack.

Shall we bump our minimum allowed scipy version to a much later one, say 1.9.1 and deal with these warnings without having to worry about older versions of scipy?

cako commented 1 year ago

I would prefer to add another if because I think 1.9.1 is too recent to be made default. It only just got released mid last year.

mrava87 commented 1 year ago

Alright, sounds good.

Let’s hope they don’t keep changing files structure ;)