Skip to content

Commit

Permalink
pybamm-team#983 added error if BasicDFNHalfCell ran with Simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Aug 3, 2020
1 parent b40c266 commit 344c2fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pybamm/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def __init__(
):
self.parameter_values = parameter_values or model.default_parameter_values

if isinstance(model, pybamm.lithium_ion.BasicDFNHalfCell):
raise NotImplementedError(
"BasicDFNHalfCell is not compatible with Simulations yet."
)

if experiment is None:
# Check to see if the current is provided as data (i.e. drive cycle)
current = self._parameter_values.get("Current function [A]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ def test_dfn_half_cell_well_posed(self):

copy = model.new_copy()
copy.check_well_posedness()

def test_dfn_half_cell_simulation_error(self):
model = pybamm.lithium_ion.BasicDFNHalfCell()
with self.assertRaisesRegex(
NotImplementedError,
"not compatible with Simulations yet."
):
pybamm.Simulation(model)


if __name__ == "__main__":
Expand Down

0 comments on commit 344c2fc

Please sign in to comment.