diff --git a/CHANGELOG.md b/CHANGELOG.md index 8967f53e..cbee60ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ ## Bug Fixes +- [#347](https://github.com/pybop-team/PyBOP/issues/347) - Resets options between MSMR tests to cope with a bug in PyBaMM v23.9 which is fixed in PyBaMM v24.1. - [#337](https://github.com/pybop-team/PyBOP/issues/337) - Restores benchmarks, relaxes CI schedule for benchmarks and scheduled tests. - [#231](https://github.com/pybop-team/PyBOP/issues/231) - Allows passing of keyword arguments to PyBaMM models and disables build on initialisation. - [#321](https://github.com/pybop-team/PyBOP/pull/321) - Improves `integration/test_spm_parameterisation.py` stability, adds flakly pytest plugin, and `test_thevenin_parameterisation.py` integration test. diff --git a/tests/unit/test_models.py b/tests/unit/test_models.py index 98ce83ef..9c11b4c6 100644 --- a/tests/unit/test_models.py +++ b/tests/unit/test_models.py @@ -12,28 +12,31 @@ class TestModels: """ @pytest.mark.parametrize( - "model_class, expected_name", + "model_class, expected_name, options", [ - (pybop.lithium_ion.SPM, "Single Particle Model"), - (pybop.lithium_ion.SPMe, "Single Particle Model with Electrolyte"), - (pybop.lithium_ion.DFN, "Doyle-Fuller-Newman"), - (pybop.lithium_ion.MPM, "Many Particle Model"), - (pybop.lithium_ion.MSMR, "Multi Species Multi Reactions Model"), - (pybop.lithium_ion.WeppnerHuggins, "Weppner & Huggins model"), - (pybop.empirical.Thevenin, "Equivalent Circuit Thevenin Model"), + (pybop.lithium_ion.SPM, "Single Particle Model", None), + (pybop.lithium_ion.SPMe, "Single Particle Model with Electrolyte", None), + (pybop.lithium_ion.DFN, "Doyle-Fuller-Newman", None), + (pybop.lithium_ion.MPM, "Many Particle Model", None), + ( + pybop.lithium_ion.MSMR, + "Multi Species Multi Reactions Model", + {"number of MSMR reactions": ("6", "4")}, + ), + (pybop.lithium_ion.WeppnerHuggins, "Weppner & Huggins model", None), + (pybop.empirical.Thevenin, "Equivalent Circuit Thevenin Model", None), ], ) @pytest.mark.unit - def test_model_classes(self, model_class, expected_name): - options = None - if model_class is pybop.lithium_ion.MSMR: - options = {"number of MSMR reactions": ("6", "4")} + def test_model_classes(self, model_class, expected_name, options): model = model_class(options=options) - assert model.pybamm_model is not None assert model.name == expected_name # Test initialisation with kwargs + if model_class is pybop.lithium_ion.MSMR: + # Reset the options to cope with a bug in PyBaMM v23.9 msmr.py:23 which is fixed in v24.1 + options = {"number of MSMR reactions": ("6", "4")} parameter_set = pybop.ParameterSet( params_dict={"Nominal cell capacity [A.h]": 5} )