Skip to content

Commit

Permalink
extend callback
Browse files Browse the repository at this point in the history
  • Loading branch information
gboehl committed Mar 28, 2023
1 parent 8c4004f commit 5d5a0ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grgrjax/newton.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5d5a0ff

Please sign in to comment.