Skip to content

Commit

Permalink
Show the progress of the simulation
Browse files Browse the repository at this point in the history
This is very simple but it is better than to hang up until finished.
  • Loading branch information
schneiderfelipe committed Jan 22, 2022
1 parent dec2297 commit 2d4d894
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions overreact/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def get_y(
jac = dydt.jac

# TODO(schneiderfelipe): log solve_ivp stuff.
logger.warning(f"@t = \x1b[94m{0:10.3f} \x1b[ms\x1b[K")
res = solve_ivp(
dydt,
t_span,
Expand Down Expand Up @@ -248,6 +249,7 @@ def _dydt(t, y):
_dydt = jit(_dydt)

def _jac(t, y):
logger.warning(f"\x1b[A@t = \x1b[94m{t:10.3f} \x1b[ms\x1b[K")
# _jac(t, y)[i, j] == d f_i / d y_j
# shape is (n_compounds, n_compounds)
return jacfwd(lambda _y: _dydt(t, _y))(y)
Expand Down

0 comments on commit 2d4d894

Please sign in to comment.