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 a8ed028 commit 8c4004f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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=None, ltime=None, verbose=True):
def callback_func(cnt, err, fev=None, misc=(), 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' | max. error {err:.2e}'
if misc is not None:
mess += f' | {misc[0]} {misc[1]:1.3f}'
mess += f' | error {err:.2e}'
for misc_m in misc:
mess += misc_m
if ltime is not None:
mess += f' | lapsed {ltime:3.4f}s'
if verbose:
Expand Down

0 comments on commit 8c4004f

Please sign in to comment.