Skip to content

Commit

Permalink
Fix divergence error message
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 10, 2025
1 parent 88f8050 commit 2440bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phiml/math/_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def _default_solve_info_msg(msg: str, converged: bool, diverged: bool, iteration
return f"Solve diverged within {iterations if iterations is not None else '?'} iterations using {method}."
elif not converged:
max_res = f"{math.max_(residual.trajectory[-1]):no-color:no-dtype}"
return f"{method} did not converge to rel_tol={float(solve.rel_tol):.0e}, abs_tol={float(solve.abs_tol):.0e} within {int(solve.max_iterations)} iterations. Max residual: {', '.join(max_res)}"
return f"{method} did not converge to rel_tol={float(solve.rel_tol):.0e}, abs_tol={float(solve.abs_tol):.0e} within {int(solve.max_iterations)} iterations. Max residual: {max_res}"
else:
return f"Converged within {iterations if iterations is not None else '?'} iterations."

Expand Down

0 comments on commit 2440bd6

Please sign in to comment.