From b40c266fa05e743215b6fc6b5003c17c7cae9e28 Mon Sep 17 00:00:00 2001 From: Ferran Brosa Planella Date: Mon, 3 Aug 2020 14:56:21 +0200 Subject: [PATCH] #983 added copy and fixed tests --- .../lithium_ion/basic_dfn_half_cell.py | 3 +++ .../test_lithium_ion/test_basic_models.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pybamm/models/full_battery_models/lithium_ion/basic_dfn_half_cell.py b/pybamm/models/full_battery_models/lithium_ion/basic_dfn_half_cell.py index 016cd74d9c..3687e5da9d 100644 --- a/pybamm/models/full_battery_models/lithium_ion/basic_dfn_half_cell.py +++ b/pybamm/models/full_battery_models/lithium_ion/basic_dfn_half_cell.py @@ -415,3 +415,6 @@ def __init__( "Terminal voltage": voltage + vdrop_Li, "Terminal voltage [V]": voltage_dim + vdrop_Li_dim, } + + def new_copy(self, build=False): + return pybamm.BaseModel.new_copy(self) diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_basic_models.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_basic_models.py index 0aaa2ea055..a270075129 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_basic_models.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_basic_models.py @@ -25,15 +25,15 @@ def test_dfn_half_cell_well_posed(self): model = pybamm.lithium_ion.BasicDFNHalfCell(options=options) model.check_well_posedness() - # copy = model.new_copy() - # copy.check_well_posedness() + copy = model.new_copy() + copy.check_well_posedness() options = {"working electrode": "negative"} model = pybamm.lithium_ion.BasicDFNHalfCell(options=options) model.check_well_posedness() - # copy = model.new_copy() - # copy.check_well_posedness() + copy = model.new_copy() + copy.check_well_posedness() if __name__ == "__main__":