timer ===== .. py:module:: pastas.timer .. autoapi-nested-parse:: This module contains 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/timer/ExceededMaxSolveTime .. autoapisummary:: pastas.timer.ExceededMaxSolveTime Classes ------- .. toctree:: :hidden: /api/pastas/timer/SolveTimer /api/pastas/timer/StatTimer .. autoapisummary:: pastas.timer.SolveTimer pastas.timer.StatTimer