Skip to content

Commit

Permalink
minor: relax rtol in test_solver
Browse files Browse the repository at this point in the history
  • Loading branch information
mrava87 committed Jun 16, 2024
1 parent 1a9549a commit 3251957
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_cg(par):
x0 = None
y1 = BDiag * x_global
xinv1 = pylops.cg(BDiag, y1, x0=x0, niter=par["nx"], tol=1e-5, show=True)[0]
assert_allclose(xinv_array, xinv1, rtol=1e-14)
assert_allclose(xinv_array, xinv1, rtol=1e-12)


@pytest.mark.mpi(min_size=2)
Expand Down Expand Up @@ -175,7 +175,7 @@ def test_cgls(par):
x0 = None
y1 = BDiag * x_global
xinv1 = pylops.cgls(BDiag, y1, x0=x0, niter=par["nx"], tol=1e-5, show=True)[0]
assert_allclose(xinv_array, xinv1, rtol=1e-14)
assert_allclose(xinv_array, xinv1, rtol=1e-12)


@pytest.mark.mpi(min_size=2)
Expand Down Expand Up @@ -222,7 +222,7 @@ def test_cgls_broadcastdata(par):
x0 = None
y1 = Hstack @ x_global
xinv1 = pylops.cgls(Hstack, y1, x0=x0, niter=par["nx"], tol=1e-5, show=True)[0]
assert_allclose(xinv_array, xinv1, rtol=1e-14)
assert_allclose(xinv_array, xinv1, rtol=1e-12)


@pytest.mark.mpi(min_size=2)
Expand Down Expand Up @@ -272,7 +272,7 @@ def test_cgls_broadcastmodel(par):
x0 = None
y1 = Vstack @ x_global
xinv1 = pylops.cgls(Vstack, y1, x0=x0, niter=par["nx"], tol=1e-5, show=True)[0]
assert_allclose(xinv_array, xinv1, rtol=1e-13)
assert_allclose(xinv_array, xinv1, rtol=1e-12)


@pytest.mark.mpi(min_size=2)
Expand Down Expand Up @@ -336,7 +336,7 @@ def test_cg_stacked(par):
x0 = None
y1 = StackedBDiag * x_global
xinv1 = pylops.cg(StackedBDiag, y1, x0=x0, niter=par["nx"], tol=1e-5, show=True)[0]
assert_allclose(xinv_array, xinv1, rtol=1e-14)
assert_allclose(xinv_array, xinv1, rtol=1e-12)


@pytest.mark.mpi(min_size=2)
Expand Down Expand Up @@ -402,4 +402,4 @@ def test_cgls_stacked(par):
x0 = None
y1 = StackedBDiag * x_global
xinv1 = pylops.cgls(StackedBDiag, y1, x0=x0, niter=par["nx"], tol=1e-5, show=True)[0]
assert_allclose(xinv_array, xinv1, rtol=1e-13)
assert_allclose(xinv_array, xinv1, rtol=1e-12)

0 comments on commit 3251957

Please sign in to comment.