diff --git a/src/festim/stepsize.py b/src/festim/stepsize.py index 1e9ff35e0..a94910f03 100644 --- a/src/festim/stepsize.py +++ b/src/festim/stepsize.py @@ -141,7 +141,7 @@ def modify_value(self, value, nb_iterations, t=None): if updated_value > time_to_milestone and not np.isclose( t, next_milestone, atol=0 ): - updated_value = next_milestone + updated_value = time_to_milestone return updated_value diff --git a/test/test_stepsize.py b/test/test_stepsize.py index 5f8bf346b..86c0dce5a 100644 --- a/test/test_stepsize.py +++ b/test/test_stepsize.py @@ -185,7 +185,7 @@ def test_overshoot_milestone(nb_its=1, target=4): value=current_value, nb_iterations=nb_its, t=0.9 ) - expected_value = 1.3 + expected_value = 1.3 - current_value assert new_value == expected_value