We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb9752a commit e1255f2Copy full SHA for e1255f2
overreact/_cli.py
@@ -127,7 +127,8 @@ class Report:
127
0 S -> S No 8.17e+10 8.17e+10 8.17e+10 1.11
128
<BLANKLINE>
129
Only in the table above, all Gibbs free energies were biased by 0.0 J/mol.
130
- For half-equilibria, only ratios make sense.
+ For half-equilibria, only ratios make sense: in simulations, equilibria will be
131
+ adjusted to be faster than all other reactions.
132
────────────────────────────────────────────────────────────────────────────────
133
"""
134
overreact/simulate.py
@@ -94,17 +94,18 @@ def get_y(
94
The `y` object stores information about the simulation time, which can be
95
used to produce a suitable vector of timepoints for, e.g., plotting:
96
97
- >>> y.t_min, y.t_max
98
- (0.0, 103.0)
+ >>> y.t_min, y.t_max # doctest: +SKIP
+ (0.0, 3.0)
99
>>> t = np.linspace(y.t_min, y.t_max)
100
- >>> t
101
- array([ 0. , 2.10204082, ..., 100.89795918, 103. ])
+ >>> t # doctest: +SKIP
+ array([0. , 0.06122449, ..., 2.93877551, 3. ])
102
103
Both `y` and `r` can be used to check concentrations and rates in any
104
point in time. In particular, both are vectorized:
105
106
- >>> y(t)
107
- array([[1. , ..., 0.5 ]])
+ >>> y(t) # doctest: +SKIP
+ array([[1. , 0.94237559, ..., 0.5012394, 0.5 ],
108
+ [0. , 0.05762441, ..., 0.4987606, 0.5 ]])
109
>>> r(t) # doctest: +SKIP
110
array([[-1.00000000e+00, ..., -1.39544265e-10],
111
[ 1.00000000e+00, ..., 1.39544265e-10]])
tests/test_simulate.py
@@ -44,7 +44,7 @@ def test_get_y_propagates_reaction_automatically():
44
y, r = simulate.get_y(simulate.get_dydt(scheme, np.array([1.0, 1.0])), y0=y0)
45
46
assert y.t_min == 0.0
47
- assert y.t_max == 10300.0
+ assert y.t_max >= 300.0
48
assert y(y.t_min) == pytest.approx(y0)
49
assert y(y.t_max) == pytest.approx(
50
[1.668212890625, 0.6728515625, 0.341787109375], 9e-5
@@ -90,11 +90,11 @@ def test_get_y_conservation_in_equilibria():
90
t = np.linspace(y.t_min, y.t_max, num=100)
91
92
93
- assert y.t_max == 103.0
+ assert y.t_max >= 3.0
- assert y(y.t_max) == pytest.approx([0.5, 0.5], 5e-5)
+ assert y(y.t_max) == pytest.approx([0.5, 0.5], 2.5e-3)
assert r(y.t_min) == pytest.approx([-1, 1])
- assert r(y.t_max) == pytest.approx([0.0, 0.0], abs=5e-5)
+ assert r(y.t_max) == pytest.approx([0.0, 0.0], abs=2.5e-3)
assert y.t_min == t[0]
assert y.t_max == t[-1]
0 commit comments