Skip to content

Commit 7853ed5

Browse files
authored
Remove internal use of deprecated set_parameters method (#4638)
* remove public `set_parameters` * Update CHANGELOG.md
1 parent 63d138d commit 7853ed5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- 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))
99
- 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))
1010

11+
## Bug fixes
12+
13+
- Remove internal use of deprecated `set_parameters` function in the `Simulation` class which caused warnings. ([#4638](https://github.com/pybamm-team/PyBaMM/pull/4638))
14+
1115
# [v24.11.2](https://github.com/pybamm-team/PyBaMM/tree/v24.11.2) - 2024-11-27
1216

1317
## Bug fixes

src/pybamm/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def build(self, initial_soc=None, inputs=None):
344344
self._model_with_set_params = self._model
345345
self._built_model = self._model
346346
else:
347-
self.set_parameters()
347+
self._set_parameters()
348348
self._mesh = pybamm.Mesh(self._geometry, self._submesh_types, self._var_pts)
349349
self._disc = pybamm.Discretisation(
350350
self._mesh, self._spatial_methods, **self._discretisation_kwargs

tests/unit/test_simulation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_basic_ops(self):
3131
assert V.has_symbol_of_classes(pybamm.Parameter)
3232
assert not V.has_symbol_of_classes(pybamm.Matrix)
3333

34-
sim.set_parameters()
34+
sim._set_parameters()
3535
assert sim._mesh is None
3636
assert sim._disc is None
3737
V = sim.model_with_set_params.variables["Voltage [V]"]
@@ -138,8 +138,8 @@ def test_solve_already_partially_processed_model(self):
138138
def test_reuse_commands(self):
139139
sim = pybamm.Simulation(pybamm.lithium_ion.SPM())
140140

141-
sim.set_parameters()
142-
sim.set_parameters()
141+
sim._set_parameters()
142+
sim._set_parameters()
143143

144144
sim.build()
145145
sim.build()
@@ -149,7 +149,7 @@ def test_reuse_commands(self):
149149

150150
sim.build()
151151
sim.solve([0, 600])
152-
sim.set_parameters()
152+
sim._set_parameters()
153153

154154
def test_set_crate(self):
155155
model = pybamm.lithium_ion.SPM()

0 commit comments

Comments
 (0)