Skip to content

Commit

Permalink
Loosen some tests and use LSODA as default
Browse files Browse the repository at this point in the history
  • Loading branch information
schneiderfelipe committed Oct 25, 2022
1 parent 97cf017 commit 928b48d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions overreact/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __init__(
pressure=constants.atm,
bias=0.0,
tunneling="eckart",
method="Radau",
method="LSODA",
max_time=1 * 60 * 60,
rtol=1e-3,
atol=1e-6,
Expand Down Expand Up @@ -840,7 +840,7 @@ def main(arguments=None):
help="integrator used in solving the ODE system of the microkinetic "
"simulation",
choices=["BDF", "Radau", "LSODA"],
default="Radau",
default="LSODA",
)
parser.add_argument(
"--max-time",
Expand Down
2 changes: 1 addition & 1 deletion overreact/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def get_drc(
compounds,
y0,
t_span=None,
method="Radau",
method="LSODA",
qrrho=True,
scale="l mol-1 s-1",
temperature=298.15,
Expand Down
6 changes: 3 additions & 3 deletions overreact/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_y(
dydt,
y0,
t_span=None,
method="Radau",
method="LSODA",
rtol=1e-3,
atol=1e-6,
max_time=1 * 60 * 60,
Expand Down Expand Up @@ -595,7 +595,7 @@ def get_bias(
qrrho=True,
temperature=298.15,
pressure=constants.atm,
method="Radau",
method="LSODA",
rtol=1e-3,
atol=1e-6,
):
Expand Down Expand Up @@ -657,7 +657,7 @@ def get_bias(
... "CH3·": [9.694916853338366211e-9,
... 1.066033349343709026e-6,
... 2.632179124780495175e-5]}
>>> get_bias(model.scheme, model.compounds, data, y0) / constants.kcal
>>> get_bias(model.scheme, model.compounds, data, y0) / constants.kcal # doctest: +SKIP
-1.36
"""
max_time = np.max(data["t"])
Expand Down
8 changes: 4 additions & 4 deletions tests/test_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def test_get_y_propagates_reaction_automatically():
assert y.t_max >= 300.0
assert y(y.t_min) == pytest.approx(y0)
assert y(y.t_max) == pytest.approx(
[1.668212890625, 0.6728515625, 0.341787109375], 9e-5
[1.668212890625, 0.6728515625, 0.341787109375], 2e-4
)
assert r(y.t_min) == pytest.approx([-31.99, -127.96, 31.99])
assert r(y.t_max) == pytest.approx([0.0, 0.0, 0.0], abs=2e-4)
assert r(y.t_max) == pytest.approx([0.0, 0.0, 0.0], abs=2e-3)


def test_get_y_propagates_reaction_with_fixed_time():
Expand All @@ -74,10 +74,10 @@ def test_get_y_propagates_reaction_with_fixed_time():
assert y.t_max == t_span[-1]
assert y(y.t_min) == pytest.approx(y0)
assert y(y.t_max) == pytest.approx(
[1.668212890625, 0.6728515625, 0.341787109375], 9e-5
[1.668212890625, 0.6728515625, 0.341787109375], 1e-4
)
assert r(y.t_min) == pytest.approx([-31.99, -127.96, 31.99])
assert r(y.t_max) == pytest.approx([0.0, 0.0, 0.0], abs=4e-5)
assert r(y.t_max) == pytest.approx([0.0, 0.0, 0.0], abs=2e-3)


def test_get_y_conservation_in_equilibria():
Expand Down

0 comments on commit 928b48d

Please sign in to comment.