Skip to content

Commit 8254c83

Browse files
committed
Fix test on older Python versions
1 parent d313aef commit 8254c83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pySDC/tests/test_controllers/test_controller_ParaDiag_nonMPI.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ def test_ParaDiag_convergence_rate(L, M, N, alpha):
250250
uend, stats = controller.run(u0=u0, t0=0, Tend=L * dt)
251251

252252
# test that the convergence rate in the first iteration is sufficiently small.
253-
errors = get_sorted(stats, type='e_global_post_iteration', sortby='iter', time=(L - 1) * dt)
253+
t_last = max([me[0] for me in get_sorted(stats, type='e_global_post_iteration')])
254+
errors = get_sorted(stats, type='e_global_post_iteration', sortby='iter', time=t_last)
254255
convergence_rates = [errors[i + 1][1] / errors[i][1] for i in range(len(errors) - 1)]
255256
convergence_rate = convergence_rates[0]
256257
convergence_bound = alpha / (1 - alpha)

0 commit comments

Comments
 (0)