Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pipliggins committed Sep 19, 2024
1 parent 06d7ecc commit 37c94f9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/unit/test_solvers/test_idaklu_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,3 +1162,23 @@ def test_python_idaklu_deprecation_errors(self):
match="Unsupported evaluation engine for convert_to_format=jax",
):
_ = solver.solve(model, t_eval)

def test_extrapolation_events_with_output_variables(self):
# Make sure the extrapolation checks work with output variables
model = pybamm.BaseModel()
v = pybamm.Variable("v")
c = pybamm.Variable("c")
model.variables = {"v": v, "c": c}
model.rhs = {v: -1, c: 0}
model.initial_conditions = {v: 1, c: 2}
model.events.append(
pybamm.Event(
"Ignored event",
v + 10,
pybamm.EventType.INTERPOLANT_EXTRAPOLATION,
)
)
solver = pybamm.IDAKLUSolver(output_variables=["c"])
solver.set_up(model)

solver.solve(model, t_eval=[0, 1])

0 comments on commit 37c94f9

Please sign in to comment.