pastas.solver.timer.SolveTimer#

class pastas.solver.timer.SolveTimer(*args: Any, max_time: float | None = None, **kwargs: Any)#

Progress indicator for model optimization.

Examples

Print timer and number of iterations in console while running ml.solve():

with SolveTimer() as t:
    ml.solve(callback=t.timer)

This prints the following to the console, for example:

Optimization progress: 73it [00:01, 67.68it/s]

Notes

If the logger is also printing messages to the console the timer will not be updated quite as nicely.

Methods#

timer(p[, n])

Timer callback for ps.solver.LeastSquares.solve().