timer ===== .. py:module:: pastas.solver.timer .. autoapi-nested-parse:: Module containing a timer for model optimization. The timer prints the time elapsed and number of iterations. Optionally, a maximum solve time can be specified, to abort long optimizations. This class is not automatically imported in pastas and requires the tqdm module (``pip install tqdm``). .. rubric:: Examples Usage:: from pastas.timer import SolveTimer with SolveTimer(max_time=60) as t: # max time in seconds ml.solve(callback=t.timer) This will print the following to the console:: Optimization progress: 73it [00:01, 67.68it/s] .. !! processed by numpydoc !! Exceptions ---------- .. toctree:: :hidden: /api/pastas/solver/timer/ExceededMaxSolveTime .. autoapisummary:: pastas.solver.timer.ExceededMaxSolveTime Classes ------- .. toctree:: :hidden: /api/pastas/solver/timer/SolveTimer /api/pastas/solver/timer/StatTimer .. autoapisummary:: pastas.solver.timer.SolveTimer pastas.solver.timer.StatTimer