Skip to content

Commit

Permalink
Fix tests due to longer default simulation times
Browse files Browse the repository at this point in the history
  • Loading branch information
schneiderfelipe committed Nov 26, 2021
1 parent 7db8feb commit 0f1dafc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions overreact/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def get_y(
used to produce a suitable vector of timepoints for, e.g., plotting:
>>> y.t_min, y.t_max
(0.0, 14.0)
(0.0, 103.0)
>>> t = np.linspace(y.t_min, y.t_max)
>>> t
array([ 0. , 0.28571429, ..., 13.71428571, 14. ])
array([ 0. , 2.10204082, ..., 100.89795918, 103. ])
Both `y` and `r` can be used to check concentrations and rates in any
point in time. In particular, both are vectorized:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_get_y_propagates_reaction_automatically():
y, r = simulate.get_y(simulate.get_dydt(scheme, np.array([1.0, 1.0])), y0=y0)

assert y.t_min == 0.0
assert y.t_max == 1400.0
assert y.t_max == 10300.0
assert y(y.t_min) == pytest.approx(y0)
assert y(y.t_max) == pytest.approx(
[1.668212890625, 0.6728515625, 0.341787109375], 9e-5
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_get_y_conservation_in_equilibria():
t = np.linspace(y.t_min, y.t_max, num=100)

assert y.t_min == 0.0
assert y.t_max == 14.0
assert y.t_max == 103.0
assert y(y.t_min) == pytest.approx(y0)
assert y(y.t_max) == pytest.approx([0.5, 0.5], 5e-5)
assert r(y.t_min) == pytest.approx([-1, 1])
Expand Down

0 comments on commit 0f1dafc

Please sign in to comment.