Skip to content

Commit c11f068

Browse files
Merge pull request #825 from pybop-team/25.10
Release v25.10
2 parents 1f3fb2b + 06e9d38 commit c11f068

File tree

253 files changed

+17000
-33891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+17000
-33891
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,18 @@
11
# Description
22

3-
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
44

5-
## Issue reference
6-
Fixes # (issue-number)
7-
8-
## Review
9-
Before you mark your PR as ready for review, please ensure that you've considered the following:
10-
- Updated the [CHANGELOG.md](https://github.com/pybop-team/PyBOP/blob/develop/CHANGELOG.md) in reverse chronological order (newest at the top) with a concise description of the changes, including the PR number.
11-
- Noted any breaking changes, including details on how it might impact existing functionality.
5+
Fixes # (issue)
126

137
## Type of change
14-
- [ ] New Feature: A non-breaking change that adds new functionality.
15-
- [ ] Optimization: A code change that improves performance.
16-
- [ ] Examples: A change to existing or additional examples.
17-
- [ ] Bug Fix: A non-breaking change that addresses an issue.
18-
- [ ] Documentation: Updates to documentation or new documentation for new features.
19-
- [ ] Refactoring: Non-functional changes that improve the codebase.
20-
- [ ] Style: Non-functional changes related to code style (formatting, naming, etc).
21-
- [ ] Testing: Additional tests to improve coverage or confirm functionality.
22-
- [ ] Other: (Insert description of change)
23-
24-
# Key checklist:
25-
26-
- [ ] No style issues: `$ pre-commit run` (or `$ nox -s pre-commit`) (see [CONTRIBUTING.md](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md#installing-and-using-pre-commit) for how to set this up to run automatically when committing locally, in just two lines of code)
27-
- [ ] All unit tests pass: `$ nox -s tests`
28-
- [ ] The documentation builds: `$ nox -s doctest`
298

30-
You can run integration tests, unit tests, and doctests together at once, using `$ nox -s quick`.
9+
Please add a line in the relevant section of [CHANGELOG.md](https://github.com/pybop-team/PyBOP/blob/develop/CHANGELOG.md) to document the change (include PR #).
3110

32-
## Further checks:
33-
- [ ] Code is well-commented, especially in complex or unclear areas.
34-
- [ ] Added tests that prove my fix is effective or that my feature works.
35-
- [ ] Checked that coverage remains or improves, and added tests if necessary to maintain or increase coverage.
11+
# Important checks:
3612

37-
Thank you for contributing to our project! Your efforts help us to deliver great software.
13+
Please confirm the following before marking the PR as ready for review:
14+
- No style issues: `$ pre-commit run` or `$ nox -s pre-commit` (see [CONTRIBUTING.md](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md#installing-and-using-pre-commit) for how to set this up to run automatically when committing locally, in just two lines of code)
15+
- All tests pass: `nox -s tests`
16+
- The documentation builds: `nox -s doctest`
17+
- Code is commented for hard-to-understand areas
18+
- Tests added that prove fix is effective or that feature works

.github/workflows/scheduled_tests.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ jobs:
9393
python -m pip install --upgrade pip nox[uv]
9494
9595
- name: Unit tests with nox
96-
run: python -m nox -s coverage
96+
run: python -m nox -s unit
97+
98+
- name: Integration tests with nox
99+
run: python -m nox -s integration
97100

98101
- name: Run examples with nox
99102
run: python -m nox -s examples
@@ -133,7 +136,8 @@ jobs:
133136
eval "$(pyenv init -)"
134137
pyenv activate pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
135138
python -m pip install --upgrade pip nox[uv]
136-
python -m nox -s coverage
139+
python -m nox -s unit
140+
python -m nox -s integration
137141
python -m nox -s examples
138142
139143
- name: Uninstall pyenv-virtualenv & python

.github/workflows/test_on_pull_request.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
fail-fast: false
6464
matrix:
6565
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
66-
python-version: ["3.9", "3.10", "3.11", "3.12"]
66+
python-version: ["3.10", "3.11", "3.12"]
6767
exclude: # We run the coverage tests on macos-14 with Python 3.12
6868
- os: macos-14
6969
python-version: "3.12"
@@ -109,6 +109,28 @@ jobs:
109109
run: |
110110
nox -s examples
111111
112+
# Notebooks on macos-14
113+
example_notebooks:
114+
needs: style
115+
runs-on: macos-14
116+
strategy:
117+
fail-fast: false
118+
name: Test notebooks (macos-14 / Python 3.12)
119+
120+
steps:
121+
- uses: actions/checkout@v4
122+
- name: Set up Python 3.12
123+
uses: actions/setup-python@v4
124+
with:
125+
python-version: 3.12
126+
- name: Install dependencies
127+
run: |
128+
python -m pip install --upgrade pip nox[uv] openpyxl ipywidgets
129+
130+
- name: Run notebooks
131+
run: |
132+
nox -s notebooks
133+
112134
# Quick benchmarks on macos-14
113135
benchmarks:
114136
needs: style

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
ci:
22
autoupdate_commit_msg: "chore: update pre-commit hooks"
33
autofix_commit_msg: "style: pre-commit fixes"
4+
autoupdate_schedule: monthly
45

56
repos:
67
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: "v0.12.3"
8+
rev: "v0.13.3"
89
hooks:
910
- id: ruff
1011
args: [--fix, --show-fixes]
@@ -13,7 +14,7 @@ repos:
1314
types_or: [python, pyi, jupyter]
1415

1516
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v5.0.0
17+
rev: v6.0.0
1718
hooks:
1819
- id: check-added-large-files
1920
args: ['--maxkb=2000']

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,44 @@
88

99
## Breaking Changes
1010

11+
# [v25.10](https://github.com/pybop-team/PyBOP/tree/v25.10) - 2025-10-31
12+
13+
This release presents a major restructure of PyBOP's base classes. We move from setting up a model, problem, cost,
14+
then optimiser to defining a simulator, cost, problem, and then optimiser. A `pybop.pybamm.Simulator` is designed
15+
to simulate a `pybamm.BaseModel`. Optimisation parameters can be passed through a `pybamm.ParameterValues` class.
16+
To understand how to update your use of PyBOP, please take a look at the example notebooks and scripts.
17+
18+
## Breaking Changes
19+
20+
- [#820](https://github.com/pybop-team/PyBOP/pull/820) - Remove the `name` property from `pybop.Parameter`
21+
- [#821](https://github.com/pybop-team/PyBOP/pull/821) - Remove the `papers` folder and update Readme.
22+
- [#809](https://github.com/pybop-team/PyBOP/pull/809) - Major restructure, including:
23+
- Deprecate Python 3.9 support
24+
- Update initial state setting (requires PyBaMM > 25.8)
25+
- Remove jax methods
26+
- Add PyBaMM and PyBaMM-EIS simulators for rebuilding and running simulations for a given set of input parameters
27+
- Remove PyBaMM wrappers and enable use of PyBaMM model, parameter values and experiment classes
28+
- Remove observers
29+
- Remove standalone class examples
30+
- Improve logging
31+
- Remove Optimisation and MCMCSampler wrapper classes
32+
- Remove Fisher information computation
33+
- Rename `apply_transform` argument to `transformed`
34+
- Remove the `update_capacity` option from the `DesignProblem`
35+
- Update sensitivities retrieval (for PyBaMM 25.8)
36+
- Remove uninformative examples
37+
- Move optimiser and sampler options into defined classes
38+
- Add PyBaMM utilities, design variable definitions and the `add_variable_to_model` function
39+
- Allow plotting via functions on the `OptimisationResult`
40+
- Separate the cost classes from the `Problem`
41+
- Replace `FittingProblem` and `DesignProblem` by a single `Problem` class
42+
- Rename and reimplement `MultiFittingProblem` as `MetaProblem`
43+
- Add `BaseSimulator` as a generic base class for the `pybop.pybamm.Simulator` and `pybop.pybamm.EISSimulator`
44+
- Enable `pybop.Parameter` objects to be passed directly to an instance of `pybamm.ParameterValues`
45+
- Update the method for setting formation concentrations to be part of the model definition
46+
- Rename some example scripts and notebooks
47+
- Update the docs and test workflows
48+
1149
# [v25.6](https://github.com/pybop-team/PyBOP/tree/v25.6) - 2025-07-16
1250

1351
## Features

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ keywords:
3131
journal: "arXiv"
3232
date-released: 2024-12-20
3333
doi: 10.48550/arXiv.2412.15859
34-
version: "25.6" # Update this alongside new releases
34+
version: "25.10" # Update this alongside new releases
3535
repository-code: 'https://www.github.com/pybop-team/pybop'

README.md

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919

2020
</div>
2121

22-
PyBOP provides a complete set of tools for parameterisation and optimisation of battery models, using both Bayesian and frequentist approaches, with [example workflows](https://github.com/pybop-team/PyBOP/tree/main/examples/) to assist the user. PyBOP can be used to parameterise various battery models, including electrochemical and equivalent circuit models available in [PyBaMM](https://pybamm.org/). PyBOP prioritises clear and informative diagnostics for the user, while also allowing for advanced probabilistic methods.
22+
PyBOP provides tools for the parameterisation and optimisation of battery models, using both Bayesian and frequentist approaches, with [example workflows](https://github.com/pybop-team/PyBOP/tree/main/examples/) to assist the user. PyBOP can be used to parameterise various battery models, including the electrochemical and equivalent circuit models available in [PyBaMM](https://pybamm.org/).
2323

24-
The diagram below shows the conceptual framework of PyBOP. This package is currently under development, so users can expect the API to evolve with future releases.
24+
📌 PyBOP v25.10 presents a [major restructure](https://github.com/pybop-team/PyBOP/tree/main/CHANGELOG.md) of PyBOP's base classes. We move from setting up
25+
a model, problem, cost, then optimiser to defining a simulator, cost, problem, and then optimiser. A `pybop.pybamm.Simulator` is designed to simulate a
26+
`pybamm.BaseModel`. Optimisation parameters can be passed through a `pybamm.ParameterValues` class.
27+
To understand how to update your use of PyBOP, please take a look at the example notebooks and scripts.
2528

2629
<p align="center">
2730
<img src="https://raw.githubusercontent.com/pybop-team/PyBOP/develop/assets/PyBOP-high-level.svg" alt="pybop_arch.svg" width="700" />
@@ -49,7 +52,9 @@ pip install pybop==v24.3
4952

5053
To check that PyBOP is installed correctly, run one of the examples in the following section. For a development installation, see the [Contribution Guide](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md#Installation). More installation information is available in our [documentation](https://pybop-docs.readthedocs.io/en/latest/installation.html) and the [extended installation instructions](https://docs.pybamm.org/en/latest/source/user_guide/installation/gnu-linux-mac.html) for PyBaMM.
5154

52-
## Using PyBOP
55+
56+
## Use Cases
57+
5358
PyBOP has two intended uses:
5459

5560
1. Parameter inference from battery test data.
@@ -58,48 +63,36 @@ PyBOP has two intended uses:
5863

5964
These include a wide variety of optimisation problems that require careful consideration due to the choice of battery model, data availability and/or the choice of design parameters.
6065

66+
### Publications
67+
68+
Please take inspiration from the following journal articles which show how PyBOP is being used for research:
69+
70+
- "Physics-based battery model parametrisation from impedance data" by [Hallemans et al. (2025)](https://doi.org/10.1149/1945-7111/add41b) with [open-source code and data](https://github.com/Battery-Intelligence-Lab/Hallemans-2025-JES)
71+
6172
### Jupyter Notebooks
6273

6374
Explore our [example notebooks](https://github.com/pybop-team/PyBOP/blob/develop/examples) for hands-on demonstrations:
6475

65-
- [Gravimetric design optimisation (SPMe)](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/design_optimisation/energy_based_electrode_design.ipynb)
66-
- [Non-linear constrained ECM parameter identification](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/ecm_trust-constr.ipynb)
67-
- [Optimiser comparison for parameter identification](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/comparison_examples/multi_optimiser_identification.ipynb)
68-
- [Parameter identification for spatial pouch cell model](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/pouch_cell_identification.ipynb)
69-
- [Estimating ECM parameters from HPPC pulse](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb)
76+
- [Getting started with gradient-based optimisation](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/getting_started/optimising_with_adamw.ipynb)
77+
- [Estimating ECM parameters from a HPPC pulse](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb)
78+
- [Identifying ECM parameters with nonlinear constraints](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/ecm_scipy_constraints.ipynb)
79+
- [Parameter identification for a spatial pouch cell model](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/battery_parameterisation/pouch_cell_identification.ipynb)
80+
- [Energy-based electrode design optimisation](https://nbviewer.org/github/pybop-team/PyBOP/blob/develop/examples/notebooks/design_optimisation/energy_based_electrode_design.ipynb)
7081

7182
### Python Scripts
7283

7384
Find additional script-based examples in the [examples directory](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/):
7485

75-
- [UKF parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/unscented_kalman_filter.py)
76-
- [BPX format parameter import/export](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/simple_BPX.py)
77-
- [Electrochemical Impendence Spectroscopy (EIS) parameter identification](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/battery_parameterisation/simple_eis.py)
78-
- [Maximum a Posteriori parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/maximum_a_posteriori.py)
79-
- [Gradient-based parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/adamw.py)
86+
- [Getting started with SciPy minimize](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/optimising_with_scipy_minimize.py)
87+
- [Estimating diffusivity from GITT data](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/battery_parameterisation/gitt_fitting.py)
88+
- [Maximum a Posteriori parameter identification](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/maximum_a_posteriori.py)
89+
- [Using electrochemical impedance spectroscopy (EIS) data](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/battery_parameterisation/simple_eis.py)
90+
- [Getting started with MCMC samplers](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/monte_carlo_sampling.py)
8091

8192

82-
### Supported Methods
83-
The table below lists the currently supported [models](https://github.com/pybop-team/PyBOP/tree/develop/pybop/models), [optimisers](https://github.com/pybop-team/PyBOP/tree/develop/pybop/optimisers), and [cost functions](https://github.com/pybop-team/PyBOP/tree/develop/pybop/costs) in PyBOP.
84-
85-
<p align="center">
86-
87-
| Battery Models | Cost Functions | Optimization Algorithms |
88-
|-----------------------------------------------|------------------------------------|--------------------------------------------------------------------|
89-
| Single Particle Model (SPM) | Sum of Squared Error (SSE) | Covariance Matrix Adaptation Evolution Strategy (CMA-ES) <tr></tr> |
90-
| Single Particle Model with Electrolyte (SPMe) | Root Mean Squared Error (RMSE) | Particle Swarm Optimization (PSO) <tr></tr> |
91-
| Doyle-Fuller-Newman (DFN) | Mean Squared Error (MSE) | Exponential Natural Evolution Strategy (xNES) <tr></tr> |
92-
| Many Particle Model (MPM) | Mean Absolute Error (MAE) | Separable Natural Evolution Strategy (sNES) <tr></tr> |
93-
| Multi-Species Multi-Reaction (MSMR) | Minkowski | Weight Decayed Adaptive Moment Estimation (AdamW) <tr></tr> |
94-
| Weppner-Huggins | Sum of Power | Improved Resilient Backpropagation (iRProp-) <tr></tr> |
95-
| Equivalent Circuit Models (ECM) | Gaussian Log Likelihood | SciPy Minimize & Differential Evolution <tr></tr> |
96-
| Grouped-parameter SPM (GroupedSPM) | Log Posterior | Cuckoo Search <tr></tr> |
97-
| Grouped-parameter SPMe (GroupedSPMe) | Gravimetric Energy / Power Density | Simulated Annealing <tr></tr> |
98-
| | Volumetric Energy / Power Density | Random Search <tr></tr> |
99-
| | | Gradient Descent <tr></tr> |
100-
| | | Nelder Mead <tr></tr> |
101-
102-
</p>
93+
### Grouped Models
94+
In addition to the models available in PyBaMM, PyBOP currently hosts some grouped-parameter versions of common battery models which are
95+
purpose-built for parameter esimation and can be found under [models](https://github.com/pybop-team/PyBOP/tree/develop/pybop/models).
10396

10497

10598
## Code of Conduct

0 commit comments

Comments
 (0)