Commit 4a6830ff authored by Bas Nijholt's avatar Bas Nijholt Committed by Bas Nijholt
Browse files

Fix ImportError for scipy 1.8.0

See
- https://github.com/scipy/scipy/pull/15220
- https://github.com/scipy/scipy/issues/14360


Currently, it gives the following error message:
```
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Input In [29], in <module>
----> 1 from scipy.sparse.linalg import linsolve

ImportError: cannot import name 'linsolve' from 'scipy.sparse.linalg' (/nfshome/basnijholt/mambaforge/envs/qms-lab-20220224-main/lib/python3.9/site-packages/scipy/sparse/linalg/__init__.py)
```

With this change, the following warning is emitted:
```
/tmp/scratch/basnijholt/ipykernel_59547/2794395227.py:1: DeprecationWarning: The module `scipy.sparse.linalg.dsolve.linsolve` is deprecated. All public names must be imported directly from the `scipy.sparse.linalg` namespace.
  from scipy.sparse.linalg.dsolve import linsolve
```

The following gives no warning:
```
from scipy.sparse.linalg._dsolve import linsolve
```

However, we should reconsider using private features.
parent 0e398ff4
......@@ -13,7 +13,7 @@ import scipy.sparse as sp
from . import common
# Note: previous code would have failed if UMFPACK was provided by scikit
import scipy.sparse.linalg.dsolve.linsolve as linsolve
from scipy.sparse.linalg.dsolve import linsolve
# check if we are actually using UMFPACK or rather SuperLU
# TODO: remove the try (only using the except clause) once we depend on
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment