Skip to content

Commit 869ddc5

Browse files
authored
Merge pull request #589 from mrava87/patch-scipyv14
Patch: scipy v1.11
2 parents 8094963 + 3d0b222 commit 869ddc5

File tree

11 files changed

+20
-19
lines changed

11 files changed

+20
-19
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
matrix:
99
platform: [ ubuntu-latest, macos-13 ]
10-
python-version: ["3.8", "3.9", "3.10", "3.11"]
10+
python-version: ["3.9", "3.10", "3.11"]
1111

1212
runs-on: ${{ matrix.platform }}
1313
steps:

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
# steps:
2727
# - task: UsePythonVersion@0
2828
# inputs:
29-
# versionSpec: '3.7'
29+
# versionSpec: '3.9'
3030
# architecture: 'x64'
3131
#
3232
# - script: |
@@ -55,7 +55,7 @@ jobs:
5555
steps:
5656
- task: UsePythonVersion@0
5757
inputs:
58-
versionSpec: '3.8'
58+
versionSpec: '3.9'
5959
architecture: 'x64'
6060

6161
- script: |
@@ -84,7 +84,7 @@ jobs:
8484
steps:
8585
- task: UsePythonVersion@0
8686
inputs:
87-
versionSpec: '3.8'
87+
versionSpec: '3.9'
8888
architecture: 'x64'
8989

9090
- script: |

docs/source/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The PyLops project strives to create a library that is easy to install in
99
any environment and has a very limited number of dependencies.
1010
Required dependencies are limited to:
1111

12-
* Python 3.8 or greater
12+
* Python 3.9 or greater
1313
* `NumPy <http://www.numpy.org>`_
1414
* `SciPy <http://www.scipy.org/scipylib/index.html>`_
1515

environment-dev-arm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- python>=3.6.4
99
- pip
1010
- numpy>=1.21.0,<2.0.0
11-
- scipy>=1.4.0,<=1.13.0
11+
- scipy>=1.11.0
1212
- pytorch>=1.2.0
1313
- cpuonly
1414
- pyfftw

environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- python>=3.6.4
99
- pip
1010
- numpy>=1.21.0,<2.0.0
11-
- scipy>=1.4.0,<=1.13.0
11+
- scipy>=1.11.0
1212
- pytorch>=1.2.0
1313
- cpuonly
1414
- pyfftw

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ channels:
44
dependencies:
55
- python>=3.6.4
66
- numpy>=1.21.0,<2.0.0
7-
- scipy>=1.4.0,<=1.13.0
7+
- scipy>=1.14.0

pylops/optimization/cls_leastsquares.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def run(
219219
and cupy `data`, respectively)
220220
221221
.. note::
222-
When user does not supply ``atol``, it is set to "legacy".
222+
When user supplies ``tol`` this is set to ``atol``.
223223
224224
Returns
225225
-------
@@ -238,8 +238,9 @@ def run(
238238
if x is not None:
239239
self.y_normal = self.y_normal - self.Op_normal.matvec(x)
240240
if engine == "scipy" and self.ncp == np:
241-
if "atol" not in kwargs_solver:
242-
kwargs_solver["atol"] = "legacy"
241+
if "tol" in kwargs_solver:
242+
kwargs_solver["atol"] = kwargs_solver["tol"]
243+
kwargs_solver.pop("tol")
243244
xinv, istop = sp_cg(self.Op_normal, self.y_normal, **kwargs_solver)
244245
elif engine == "pylops" or self.ncp != np:
245246
if show:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ classifiers = [
3131
]
3232
dependencies = [
3333
"numpy >= 1.21.0 , < 2.0.0",
34-
"scipy >= 1.4.0 , <= 1.13.0",
34+
"scipy >= 1.11.0",
3535
]
3636
dynamic = ["version"]
3737

pytests/test_leastsquares.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ def test_NormalEquationsInversion(par):
9393

9494
# normal equations with regularization
9595
xinv = normal_equations_inversion(
96-
Gop, y, [Reg], epsI=1e-5, epsRs=[1e-8], x0=x0, **dict(maxiter=200, tol=1e-10)
96+
Gop, y, [Reg], epsI=1e-5, epsRs=[1e-8], x0=x0, **dict(maxiter=200, atol=1e-10)
9797
)[0]
9898
assert_array_almost_equal(x, xinv, decimal=3)
9999
# normal equations with weight
100100
xinv = normal_equations_inversion(
101-
Gop, y, None, Weight=Weigth, epsI=1e-5, x0=x0, **dict(maxiter=200, tol=1e-10)
101+
Gop, y, None, Weight=Weigth, epsI=1e-5, x0=x0, **dict(maxiter=200, atol=1e-10)
102102
)[0]
103103
assert_array_almost_equal(x, xinv, decimal=3)
104104
# normal equations with weight and small regularization
@@ -110,7 +110,7 @@ def test_NormalEquationsInversion(par):
110110
epsI=1e-5,
111111
epsRs=[1e-8],
112112
x0=x0,
113-
**dict(maxiter=200, tol=1e-10)
113+
**dict(maxiter=200, atol=1e-10)
114114
)[0]
115115
assert_array_almost_equal(x, xinv, decimal=3)
116116
# normal equations with weight and small normal regularization
@@ -123,7 +123,7 @@ def test_NormalEquationsInversion(par):
123123
epsI=1e-5,
124124
epsNRs=[1e-8],
125125
x0=x0,
126-
**dict(maxiter=200, tol=1e-10)
126+
**dict(maxiter=200, atol=1e-10)
127127
)[0]
128128
assert_array_almost_equal(x, xinv, decimal=3)
129129

@@ -192,7 +192,7 @@ def test_WeightedInversion(par):
192192
y = Gop * x
193193

194194
xne = normal_equations_inversion(
195-
Gop, y, None, Weight=Weigth, **dict(maxiter=5, tol=1e-10)
195+
Gop, y, None, Weight=Weigth, **dict(maxiter=5, atol=1e-10)
196196
)[0]
197197
xreg = regularized_inversion(
198198
Gop, y, None, Weight=Weigth1, **dict(damp=0, iter_lim=5, show=0)

pytests/test_linearoperator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_sparse(par):
122122
D = np.diag(diag)
123123
Dop = Diagonal(diag, dtype=par["dtype"])
124124
S = Dop.tosparse()
125-
assert_array_equal(S.A, D)
125+
assert_array_equal(S.toarray(), D)
126126

127127

128128
@pytest.mark.parametrize("par", [(par1), (par2), (par1j)])

0 commit comments

Comments
 (0)