Skip to content

Commit 4d656cb

Browse files
committed
new
1 parent e63cb19 commit 4d656cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/test_timeevol.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,10 @@ def do5_ode_solver_(params):
282282
v2, g2 = s2
283283
v3, g3 = s3
284284

285-
assert (np.linalg.norm(v1 - v2) < 1e-8) & (np.linalg.norm(v1 - v3) < 1e-8)
286-
assert (np.linalg.norm(g1 - g2) < 1e-8) & (np.linalg.norm(g1 - g3) < 1e-8)
285+
np.testing.assert_allclose(g1, g3, atol=1e-8, rtol=0)
286+
np.testing.assert_allclose(g1, g2, atol=1e-8, rtol=0)
287+
np.testing.assert_allclose(v1, v3, atol=1e-8, rtol=0)
288+
np.testing.assert_allclose(v1, v2, atol=1e-8, rtol=0)
287289

288290
######################################################################
289291

@@ -336,7 +338,9 @@ def do5_ode_solver_local(paras):
336338
s2 = do5_ode_solver_local(paras)
337339
v1, g1 = s1
338340
v2, g2 = s2
339-
assert (np.linalg.norm(v1 - v2) < 1e-8) & (np.linalg.norm(g1 - g2) < 1e-8)
341+
342+
np.testing.assert_allclose(g1, g2, atol=1e-8, rtol=0)
343+
np.testing.assert_allclose(v1, v2, atol=1e-8, rtol=0)
340344

341345

342346
@pytest.mark.parametrize("backend", [lf("npb"), lf("tfb"), lf("jaxb")])

0 commit comments

Comments
 (0)