From 66766b8a976b38b34e34df3448f8d8e214febdc6 Mon Sep 17 00:00:00 2001 From: Marc Berliner <34451391+MarcBerliner@users.noreply.github.com> Date: Mon, 2 Dec 2024 15:55:17 -0500 Subject: [PATCH 1/2] remove public `set_parameters` --- src/pybamm/simulation.py | 2 +- tests/unit/test_simulation.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pybamm/simulation.py b/src/pybamm/simulation.py index cd4fc62ec8..9dafb23ce2 100644 --- a/src/pybamm/simulation.py +++ b/src/pybamm/simulation.py @@ -344,7 +344,7 @@ def build(self, initial_soc=None, inputs=None): self._model_with_set_params = self._model self._built_model = self._model else: - self.set_parameters() + self._set_parameters() self._mesh = pybamm.Mesh(self._geometry, self._submesh_types, self._var_pts) self._disc = pybamm.Discretisation( self._mesh, self._spatial_methods, **self._discretisation_kwargs diff --git a/tests/unit/test_simulation.py b/tests/unit/test_simulation.py index becd70cbe4..d32e5fa3f7 100644 --- a/tests/unit/test_simulation.py +++ b/tests/unit/test_simulation.py @@ -31,7 +31,7 @@ def test_basic_ops(self): assert V.has_symbol_of_classes(pybamm.Parameter) assert not V.has_symbol_of_classes(pybamm.Matrix) - sim.set_parameters() + sim._set_parameters() assert sim._mesh is None assert sim._disc is None V = sim.model_with_set_params.variables["Voltage [V]"] @@ -138,8 +138,8 @@ def test_solve_already_partially_processed_model(self): def test_reuse_commands(self): sim = pybamm.Simulation(pybamm.lithium_ion.SPM()) - sim.set_parameters() - sim.set_parameters() + sim._set_parameters() + sim._set_parameters() sim.build() sim.build() @@ -149,7 +149,7 @@ def test_reuse_commands(self): sim.build() sim.solve([0, 600]) - sim.set_parameters() + sim._set_parameters() def test_set_crate(self): model = pybamm.lithium_ion.SPM() From d45d388f21369f705a249625d2b4c1275d0be2c0 Mon Sep 17 00:00:00 2001 From: Marc Berliner <34451391+MarcBerliner@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:02:18 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c266ea559d..7954585f09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - Separated extrapolation options for `pybamm.BoundaryValue` and `pybamm.BoundaryGradient`, and updated the default to be "linear" for the value and "quadratic" for the gradient. ([#4614](https://github.com/pybamm-team/PyBaMM/pull/4614)) - Double-layer SEI models have been removed (with the corresponding parameters). All models assume now a single SEI layer. ([#4470](https://github.com/pybamm-team/PyBaMM/pull/4470)) +## Bug fixes + +- Remove internal use of deprecated `set_parameters` function in the `Simulation` class which caused warnings. ([#4638](https://github.com/pybamm-team/PyBaMM/pull/4638)) + # [v24.11.2](https://github.com/pybamm-team/PyBaMM/tree/v24.11.2) - 2024-11-27 ## Bug fixes