From 5d5a0ff7a74eb96a6f029f292510a5ef030e40b0 Mon Sep 17 00:00:00 2001 From: Gregor Boehl Date: Tue, 28 Mar 2023 19:15:47 +0200 Subject: [PATCH] extend callback --- grgrjax/newton.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grgrjax/newton.py b/grgrjax/newton.py index a8a0d72..01ab9a9 100644 --- a/grgrjax/newton.py +++ b/grgrjax/newton.py @@ -26,15 +26,15 @@ def _newton_body_func(carry): return (xi, eps, cnt+1), (func, verbose, maxit, tol) -def callback_func(cnt, err, fev=None, misc=(), ltime=None, verbose=True): +def callback_func(cnt, err, *args, fev=None, ltime=None, verbose=True): """Print a formatted on-line update for a iterative process. """ mess = f' Iteration {cnt:2d}' if fev is not None: mess += f' | fev. {fev:3d}' mess += f' | error {err:.2e}' - for misc_m in misc: - mess += misc_m + for misc in args: + mess += misc if ltime is not None: mess += f' | lapsed {ltime:3.4f}s' if verbose: