Skip to content

Commit

Permalink
Merge pull request #654 from pybop-team/25.1
Browse files Browse the repository at this point in the history
Release v25.1
  • Loading branch information
BradyPlanden authored Feb 4, 2025
2 parents e46015e + a29db68 commit 24c54d9
Show file tree
Hide file tree
Showing 154 changed files with 4,285 additions and 2,625 deletions.
18 changes: 18 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@
"test",
"code"
]
},
{
"login": "noelhallemans",
"name": "Noël Hallemans",
"avatar_url": "https://avatars.githubusercontent.com/u/90609505?v=4",
"profile": "https://eng.ox.ac.uk/people/noel-hallemans/",
"contributions": [
"example"
]
},
{
"login": "pipliggins",
"name": "Pip Liggins",
"avatar_url": "https://avatars.githubusercontent.com/u/55396775?v=4",
"profile": "https://github.com/pipliggins",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.3"
rev: "v0.9.4"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@

## Breaking Changes


# [v25.1](https://github.com/pybop-team/PyBOP/tree/v25.1) - 2025-02-03

## Features

- [#636](https://github.com/pybop-team/PyBOP/pull/636) - Adds `pybop.IRPropPlus` optimiser with corresponding tests.
- [#635](https://github.com/pybop-team/PyBOP/pull/635) - Adds support for multi-proposal evaluation of list-like objects to `BaseCost` classes.
- [#635](https://github.com/pybop-team/PyBOP/pull/635) - Adds global parameter sensitivity analysis with method `BaseCost.sensitivity_analysis`. This is computation is added to `OptimisationResult` if optimiser arg `compute_sensitivities` is `True`. An additional arg is added to select the number of samples for analysis: `n_sensitivity_samples`.
- [#630] (https://github.com/pybop-team/PyBOP/pull/632) - Fisher Information Matrix added to `BaseLikelihood` class.
- [#619](https://github.com/pybop-team/PyBOP/pull/619) - Adds `pybop.SimulatingAnnealing` optimiser with corresponding tests.
- [#565](https://github.com/pybop-team/PyBOP/pull/627) - DigiBatt added as funding partner.

## Optimisations

- [#638](https://github.com/pybop-team/PyBOP/pull/638) - Allows the problem class to accept any domain name.
- [#618](https://github.com/pybop-team/PyBOP/pull/618) - Adds Mean Absolute Error (MAE) and Mean Squared Error (MSE) costs.
- [#601](https://github.com/pybop-team/PyBOP/pull/601) - Deprecates `MultiOptimisationResult` by merging with `OptimisationResult`.
- [#600](https://github.com/pybop-team/PyBOP/pull/600) - Removes repetitious functionality within the cost classes.

## Bug Fixes

- [#602](https://github.com/pybop-team/PyBOP/pull/602) - Aligns the standard quick plot of `MultiFittingProblem` outputs.

## Breaking Changes

- [#656](https://github.com/pybop-team/PyBOP/pull/656) - Completes `ParameterSet` changes from #593 and aligns the simulation options in `model.predict` with the model properties such as the solver.
- [#593](https://github.com/pybop-team/PyBOP/pull/593) - Enables `ParameterSet` to systematically return a `pybamm.ParameterValues` object within the model class.

# [v24.12](https://github.com/pybop-team/PyBOP/tree/v24.12) - 2024-12-21

## Features
Expand Down
30 changes: 25 additions & 5 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
cff-version: 1.2.0
title: 'Python Battery Optimisation and Parameterisation (PyBOP)'
title: 'PyBOP: A Python package for battery model optimisation and parameterisation'
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
If you use this software, please cite the article below.
authors:
- given-names: Brady
family-names: Planden
orcid: "https://orcid.org/0000-0002-1082-9125"
- given-names: Nicola
family-names: Courtier
orcid: "https://orcid.org/0000-0002-5714-1096"
- given-names: Martin
family-names: Robinson
orcid: "https://orcid.org/0000-0002-1572-6782"
- given-names: Agriya
family-names: Khetarpal
orcid: "https://orcid.org/0000-0002-1112-1786"
- given-names: Ferran
family-names: Brosa Planella
orcid: "https://orcid.org/0000-0001-6363-2812"
- given-names: David
family-names: Howey
version: "24.12" # Update this when you release a new version
orcid: "https://orcid.org/0000-0002-0620-3955"

keywords:
- "python"
- "battery models"
- "parameter inference"
- "optimization"

journal: "arXiv"
date-released: 2024-12-20
doi: 10.48550/arXiv.2412.15859
version: "25.1" # Update this alongside new releases
repository-code: 'https://www.github.com/pybop-team/pybop'
40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,32 @@ Explore our [example notebooks](https://github.com/pybop-team/PyBOP/blob/develop

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

- [UKF parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/spm_UKF.py)
- [BPX format parameter import/export](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/BPX_spm.py)
- [Electrochemical Impendence Spectroscopy (EIS) parameter identification](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/battery_parameterisation/eis_fitting.py)
- [Maximum a Posteriori parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/BPX_spm.py)
- [Gradient-based parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/spm_AdamW.py)
- [UKF parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/unscented_kalman_filter.py)
- [BPX format parameter import/export](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/getting_started/simple_BPX.py)
- [Electrochemical Impendence Spectroscopy (EIS) parameter identification](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/battery_parameterisation/simple_eis.py)
- [Maximum a Posteriori parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/maximum_a_posteriori.py)
- [Gradient-based parameter identification (SPM)](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/comparison_examples/adamw.py)


### Supported Methods
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.

<p align="center">

| Battery Models | Optimization Algorithms | Cost Functions |
|-----------------------------------------------|----------------------------------------------------------|------------------------------------------|
| Single Particle Model (SPM) | Covariance Matrix Adaptation Evolution Strategy (CMA-ES) | Sum of Squared Errors (SSE) <tr></tr> |
| Single Particle Model with Electrolyte (SPMe) | Particle Swarm Optimization (PSO) | Root Mean Squared Error (RMSE) <tr></tr> |
| Doyle-Fuller-Newman (DFN) | Exponential Natural Evolution Strategy (xNES) | Minkowski <tr></tr> |
| Many Particle Model (MPM) | Separable Natural Evolution Strategy (sNES) | Sum of Power <tr></tr> |
| Multi-Species Multi-Reaction (MSMR) | Adaptive Moment Estimation with Weight Decay (AdamW) | Gaussian Log Likelihood <tr></tr> |
| Weppner-Huggins | Improved Resilient Backpropagation (iRProp-) | Log Posterior <tr></tr> |
| Equivalent Circuit Models (ECM) | SciPy Minimize & Differential Evolution | Unscented Kalman Filter (UKF) <tr></tr> |
| Grouped-parameter SPMe (GroupedSPMe) | Cuckoo Search | Gravimetric Energy Density <tr></tr> |
| | Gradient Descent | Volumetric Energy Density<tr></tr> |
| | Nelder-Mead | <tr></tr> |
| Battery Models | Cost Functions | Optimization Algorithms |
|-----------------------------------------------|------------------------------------|--------------------------------------------------------------------|
| Single Particle Model (SPM) | Sum of Squared Error (SSE) | Covariance Matrix Adaptation Evolution Strategy (CMA-ES) <tr></tr> |
| Single Particle Model with Electrolyte (SPMe) | Root Mean Squared Error (RMSE) | Particle Swarm Optimization (PSO) <tr></tr> |
| Doyle-Fuller-Newman (DFN) | Mean Squared Error (MSE) | Exponential Natural Evolution Strategy (xNES) <tr></tr> |
| Many Particle Model (MPM) | Mean Absolute Error (MAE) | Separable Natural Evolution Strategy (sNES) <tr></tr> |
| Multi-Species Multi-Reaction (MSMR) | Minkowski | Weight Decayed Adaptive Moment Estimation (AdamW) <tr></tr> |
| Weppner-Huggins | Sum of Power | Improved Resilient Backpropagation (iRProp-) <tr></tr> |
| Equivalent Circuit Models (ECM) | Gaussian Log Likelihood | SciPy Minimize & Differential Evolution <tr></tr> |
| Grouped-parameter SPMe (GroupedSPMe) | Log Posterior | Cuckoo Search <tr></tr> |
| | Gravimetric Energy / Power Density | Simulated Annealing <tr></tr> |
| | Volumetric Energy / Power Density | Random Search <tr></tr> |
| | | Gradient Descent <tr></tr> |
| | | Nelder Mead <tr></tr> |

</p>

Expand Down Expand Up @@ -141,6 +143,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/MarkBlyth"><img src="https://avatars.githubusercontent.com/u/20501619?v=4?s=100" width="100px;" alt="MarkBlyth"/><br /><sub><b>MarkBlyth</b></sub></a><br /><a href="https://github.com/pybop-team/PyBOP/commits?author=MarkBlyth" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/f-g-r-i-m-m"><img src="https://avatars.githubusercontent.com/u/137511310?v=4?s=100" width="100px;" alt="f-g-r-i-m-m"/><br /><sub><b>f-g-r-i-m-m</b></sub></a><br /><a href="#example-f-g-r-i-m-m" title="Examples">💡</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Dibyendu-IITKGP"><img src="https://avatars.githubusercontent.com/u/32595915?v=4?s=100" width="100px;" alt="Dibyendu-IITKGP"/><br /><sub><b>Dibyendu-IITKGP</b></sub></a><br /><a href="#example-Dibyendu-IITKGP" title="Examples">💡</a> <a href="https://github.com/pybop-team/PyBOP/commits?author=Dibyendu-IITKGP" title="Tests">⚠️</a> <a href="https://github.com/pybop-team/PyBOP/commits?author=Dibyendu-IITKGP" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://eng.ox.ac.uk/people/noel-hallemans/"><img src="https://avatars.githubusercontent.com/u/90609505?v=4?s=100" width="100px;" alt="Noël Hallemans"/><br /><sub><b>Noël Hallemans</b></sub></a><br /><a href="#example-noelhallemans" title="Examples">💡</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pipliggins"><img src="https://avatars.githubusercontent.com/u/55396775?v=4?s=100" width="100px;" alt="Pip Liggins"/><br /><sub><b>Pip Liggins</b></sub></a><br /><a href="https://github.com/pybop-team/PyBOP/commits?author=pipliggins" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
1,294 changes: 497 additions & 797 deletions assets/PyBOP-high-level.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion benchmarks/benchmark_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setup(self, model, parameter_set):
set_random_seed()

# Create model instance
self.model = model(parameter_set=pybop.ParameterSet.pybamm(parameter_set))
self.model = model(parameter_set=pybop.ParameterSet(parameter_set))

# Define fitting parameters
parameters = pybop.Parameters(
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_optim_construction.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setup(self, model, parameter_set, optimiser):
set_random_seed()

# Create model instance
model_instance = model(parameter_set=pybop.ParameterSet.pybamm(parameter_set))
model_instance = model(parameter_set=pybop.ParameterSet(parameter_set))

# Define fitting parameters
parameters = pybop.Parameters(
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_parameterisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setup(self, model, parameter_set, optimiser):
set_random_seed()

# Create model instance
params = pybop.ParameterSet.pybamm(parameter_set)
params = pybop.ParameterSet(parameter_set)
params.update(
{
"Negative electrode active material volume fraction": 0.63,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_track_parameterisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setup(self, model, parameter_set, optimiser):
set_random_seed()

# Create model instance
params = pybop.ParameterSet.pybamm(parameter_set)
params = pybop.ParameterSet(parameter_set)
params.update(
{
"Negative electrode active material volume fraction": 0.63,
Expand Down
8 changes: 0 additions & 8 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ def pytest_addoption(parser):
parser.addoption("--docs", action="store_true", default=False, help="run doc tests")


def pytest_terminal_summary(terminalreporter, exitstatus, config):
"""Add additional section to terminal summary reporting."""
total_time = sum([x.duration for x in terminalreporter.stats.get("passed", [])])
num_tests = len(terminalreporter.stats.get("passed", []))
print(f"\nTotal number of tests completed: {num_tests}")
print(f"Total time taken: {total_time:.2f} seconds")


def pytest_configure(config):
config.addinivalue_line("markers", "unit: mark test as a unit test")
config.addinivalue_line("markers", "integration: mark test as an integration test")
Expand Down
2 changes: 1 addition & 1 deletion docs/_extension/gallery_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def run(self) -> list[nodes.Node]:

# Parse the template with Sphinx Design to create an output container
# Prep the options for the template grid
class_ = "gallery-directive" + f' {self.options.get("class-container", "")}'
class_ = "gallery-directive" + f" {self.options.get('class-container', '')}"
options = {"gutter": 2, "class-container": class_}
options_str = "\n".join(f":{k}: {v}" for k, v in options.items())

Expand Down
11 changes: 8 additions & 3 deletions docs/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
"url": "https://pybop-docs.readthedocs.io/en/latest/"
},
{
"name": "v24.12 (stable)",
"version": "v24.12",
"url": "https://pybop-docs.readthedocs.io/en/v24.12/",
"name": "v25.1 (stable)",
"version": "v25.1",
"url": "https://pybop-docs.readthedocs.io/en/v25.1/",
"preferred": true
},
{
"name": "v24.12",
"version": "v24.12",
"url": "https://pybop-docs.readthedocs.io/en/v24.12/"
},
{
"name": "v24.9",
"version": "v24.9",
Expand Down
Loading

0 comments on commit 24c54d9

Please sign in to comment.