Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: pybamm.Simulation.set_parameters and pybamm.Simulation.set_up_and_parameterise_experiment made private in simulation.py #4489

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

## Breaking changes

- Deprecated `pybamm.Simulation.set_parameters` and `pybamm.Simulation. set_up_and_parameterise_experiment` functions in `pybamm.simulation.py`. ([#3752](https://github.com/pybamm-team/PyBaMM/pull/3752))
- Removed all instances of `param = self.param` and now directly access `self.param` across the codebase. This change simplifies parameter references and enhances readability. ([#4484](https://github.com/pybamm-team/PyBaMM/pull/4494))
- Removed the deprecation warning for the chemistry argument in
ParameterValues ([#4466](https://github.com/pybamm-team/PyBaMM/pull/4466))
Expand Down
15 changes: 13 additions & 2 deletions src/pybamm/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@
)

def set_up_and_parameterise_experiment(self, solve_kwargs=None):
msg = "pybamm.simulation.set_up_and_parameterise_experiment is deprecated and not meant to be accessed by users."
warnings.warn(msg, DeprecationWarning, stacklevel=2)
self._set_up_and_parameterise_experiment(solve_kwargs=solve_kwargs)

Check warning on line 181 in src/pybamm/simulation.py

View check run for this annotation

Codecov / codecov/patch

src/pybamm/simulation.py#L179-L181

Added lines #L179 - L181 were not covered by tests

def _set_up_and_parameterise_experiment(self, solve_kwargs=None):
"""
Create and parameterise the models for each step in the experiment.

Expand Down Expand Up @@ -254,10 +259,16 @@
)

def set_parameters(self):
msg = (
"pybamm.set_parameters is deprecated and not meant to be accessed by users."
)
warnings.warn(msg, DeprecationWarning, stacklevel=2)
self._set_parameters()

def _set_parameters(self):
"""
A method to set the parameters in the model and the associated geometry.
"""

if self._model_with_set_params:
return

Expand Down Expand Up @@ -355,7 +366,7 @@
if self.steps_to_built_models:
return
else:
self.set_up_and_parameterise_experiment(solve_kwargs)
self._set_up_and_parameterise_experiment(solve_kwargs)

# Can process geometry with default parameter values (only electrical
# parameters change between parameter values)
Expand Down