Skip to content

Commit d2d955e

Browse files
committed
use math.isclose
1 parent 4da759f commit d2d955e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adaptive/tests/test_learners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def test_learner_performance_is_invariant_under_scaling(learner_type, f, learner
397397
assert np.allclose(xs_unscaled, cxs)
398398

399399
# Check if the losses are close
400-
assert abs(learner.loss() - control.loss()) / learner.loss() < 1e-11
400+
assert math.isclose(learner.loss(), control.loss(), rel_tol=1e-10)
401401

402402

403403
@run_with(Learner1D, Learner2D, LearnerND, AverageLearner,

0 commit comments

Comments
 (0)