From 7abe1a0f2abc1a7db814608472c5c8553dc07d3b Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Fri, 3 Jan 2025 11:20:49 +0000 Subject: [PATCH] Only redraw the convergence plot when its has new values --- mantidimaging/core/reconstruct/cil_recon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mantidimaging/core/reconstruct/cil_recon.py b/mantidimaging/core/reconstruct/cil_recon.py index 13372d29fa4..dbf45e6f52c 100644 --- a/mantidimaging/core/reconstruct/cil_recon.py +++ b/mantidimaging/core/reconstruct/cil_recon.py @@ -43,7 +43,9 @@ def __init__(self, verbose=1, progress: Progress | None = None) -> None: def __call__(self, algo: Algorithm) -> None: if self.progress: - extra_info = {'iterations': algo.iterations, 'losses': algo.loss} + extra_info = {} + if algo.iterations and algo.iterations[-1] == algo.iteration: + extra_info = {'iterations': algo.iterations, 'losses': algo.loss} if algo.last_residual and algo.last_residual[0] == algo.iteration: extra_info["residual"] = algo.last_residual[1] self.progress.update(