From 0f1dafc0998b71cea61fe8fb1546449f7720eba3 Mon Sep 17 00:00:00 2001 From: "Felipe S. S. Schneider" Date: Fri, 26 Nov 2021 16:33:23 -0300 Subject: [PATCH] Fix tests due to longer default simulation times --- overreact/simulate.py | 4 ++-- tests/test_simulate.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/overreact/simulate.py b/overreact/simulate.py index 39a82fbb..29e28db2 100644 --- a/overreact/simulate.py +++ b/overreact/simulate.py @@ -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: diff --git a/tests/test_simulate.py b/tests/test_simulate.py index 285bcdf0..b29dfc6d 100644 --- a/tests/test_simulate.py +++ b/tests/test_simulate.py @@ -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 @@ -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])