Skip to content

Commit 99632b9

Browse files
authored
Merge pull request #491 from pybop-team/release-v24.9
Release v24.9.0
2 parents eefd9e7 + 061fef9 commit 99632b9

131 files changed

Lines changed: 15444 additions & 11605 deletions

File tree

Some content is hidden

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

.all-contributorsrc

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"profile": "https://www.brosaplanella.xyz",
6363
"contributions": [
6464
"review",
65-
"code"
65+
"code",
66+
"example"
6667
]
6768
},
6869
{
@@ -97,7 +98,7 @@
9798
{
9899
"login": "IntelLiGent",
99100
"name": "Horizon Europe IntelLiGent Consortium",
100-
"avatar_url": "assets/logo-farger.pdf",
101+
"avatar_url": "assets/logo-farger.svg",
101102
"profile": "https://heuintelligent.eu/",
102103
"contributions": [
103104
"financial"
@@ -111,6 +112,24 @@
111112
"contributions": [
112113
"code"
113114
]
115+
},
116+
{
117+
"login": "MarkBlyth",
118+
"name": "MarkBlyth",
119+
"avatar_url": "https://avatars.githubusercontent.com/u/20501619?v=4",
120+
"profile": "https://github.com/MarkBlyth",
121+
"contributions": [
122+
"code"
123+
]
124+
},
125+
{
126+
"login": "f-g-r-i-m-m",
127+
"name": "f-g-r-i-m-m",
128+
"avatar_url": "https://avatars.githubusercontent.com/u/137511310?v=4",
129+
"profile": "https://github.com/f-g-r-i-m-m",
130+
"contributions": [
131+
"example"
132+
]
114133
}
115134
],
116135
"contributorsPerLine": 7,
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Lychee Link Checking
2+
3+
name: Links
4+
on:
5+
workflow_dispatch:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '0 6 * * 0' # Run weekly on Sundays at 06:00 UTC
12+
13+
jobs:
14+
Lychee:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Restore lychee cache
21+
uses: actions/cache@v4
22+
with:
23+
path: .lycheecache
24+
key: cache-lychee-${{ github.sha }}
25+
restore-keys: cache-lychee-
26+
27+
- name: Set up Lychee
28+
uses: lycheeverse/lychee-action@v1.10.0
29+
with:
30+
args: >-
31+
--cache
32+
--no-progress
33+
--max-cache-age 2d
34+
--timeout 10
35+
--max-retries 5
36+
--skip-missing
37+
--exclude-loopback
38+
--accept 200,429
39+
--exclude "https://tiles.stadiamaps.com/*|https://b.tile.openstreetmap.org/*"
40+
--exclude "https://cartodb-basemaps-c.global.ssl.fastly.net/*"
41+
--exclude "https://events.mapbox.com/*|https://events.mapbox.cn/*|https://api.mapbox.cn/*"
42+
--exclude "https://github.com/mikolalysenko/glsl-read-float/*"
43+
--exclude "https://fonts.openmaptiles.org/*"
44+
--exclude "https://a.tile.openstreetmap.org/*"
45+
--exclude "https://openstreetmap.org/*|https://www.openstreetmap.org/*"
46+
--exclude "https://cdn.plot.ly/*"
47+
--exclude "http://www.w3.org/*|https://www.w3.org/*"
48+
--exclude "https://doi.org/*"
49+
--exclude "https://raw.githubusercontent.com/paramm-team/pybamm-param/develop/pbparam/input/data/"
50+
--exclude-path ./CHANGELOG.md
51+
--exclude-path asv.conf.json
52+
--exclude-path docs/conf.py
53+
'./**/*.rst'
54+
'./**/*.md'
55+
'./**/*.py'
56+
'./**/*.ipynb'
57+
'./**/*.json'
58+
'./**/*.toml'
59+
fail: true
60+
jobSummary: true
61+
format: markdown

.github/workflows/test_on_push.yaml renamed to .github/workflows/test_on_pull_request.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,37 @@ jobs:
105105
run: |
106106
nox -s examples
107107
108+
# Quick benchmarks on macos-14
109+
benchmarks:
110+
needs: style
111+
runs-on: macos-14
112+
strategy:
113+
fail-fast: false
114+
name: Benchmarks
115+
116+
steps:
117+
- name: Check out PyBOP repository
118+
uses: actions/checkout@v4
119+
with:
120+
fetch-depth: 2
121+
122+
- name: Set up Python 3.12
123+
id: setup-python
124+
uses: actions/setup-python@v4
125+
with:
126+
python-version: 3.12
127+
128+
- name: Install dependencies
129+
shell: bash
130+
run: |
131+
python -m pip install --upgrade pip asv[virtualenv]
132+
133+
- name: Run quick benchmarks
134+
shell: bash
135+
run: |
136+
asv machine --machine "GitHubRunner"
137+
asv run --machine "GitHubRunner" --quick --show-stderr
138+
108139
# Runs only on macos-14 with Python 3.12
109140
check_coverage:
110141
needs: style

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: "v0.5.0"
7+
rev: "v0.6.4"
88
hooks:
99
- id: ruff
1010
args: [--fix, --show-fixes]
@@ -32,3 +32,9 @@ repos:
3232
- id: rst-backticks
3333
- id: rst-directive-colons
3434
- id: rst-inline-touching-normal
35+
36+
- repo: https://github.com/kynan/nbstripout
37+
rev: 0.7.1
38+
hooks:
39+
- id: nbstripout
40+
args: ['--keep-output', '--drop-empty-cells']

CHANGELOG.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,52 @@
66

77
## Breaking Changes
88

9+
# [v24.9.0](https://github.com/pybop-team/PyBOP/tree/v24.9.0) - 2024-09-10
10+
11+
## Features
12+
13+
- [#462](https://github.com/pybop-team/PyBOP/pull/462) - Enables multidimensional learning rate for `pybop.AdamW` with updated (more robust) integration testing. Fixes bug in `Minkowski` and `SumofPower` cost functions for gradient-based optimisers.
14+
- [#411](https://github.com/pybop-team/PyBOP/pull/411) - Updates notebooks with README in `examples/` directory, removes kaleido dependency and moves to nbviewer rendering, displays notebook figures with `notebook_connected` plotly renderer
15+
- [#6](https://github.com/pybop-team/PyBOP/issues/6) - Adds Monte Carlo functionality, with methods based on Pints' algorithms. A base class is added `BaseSampler`, in addition to `PintsBaseSampler`.
16+
- [#353](https://github.com/pybop-team/PyBOP/issues/353) - Allow user-defined check_params functions to enforce nonlinear constraints, and enable SciPy constrained optimisation methods
17+
- [#222](https://github.com/pybop-team/PyBOP/issues/222) - Adds an example for performing and electrode balancing.
18+
- [#441](https://github.com/pybop-team/PyBOP/issues/441) - Adds an example for estimating constants within a `pybamm.FunctionalParameter`.
19+
- [#405](https://github.com/pybop-team/PyBOP/pull/405) - Adds frequency-domain based EIS prediction methods via `model.simulateEIS` and updates to `problem.evaluate` with examples and tests.
20+
- [#460](https://github.com/pybop-team/PyBOP/pull/460) - Notebook example files added for ECM and folder structure updated.
21+
- [#450](https://github.com/pybop-team/PyBOP/pull/450) - Adds support for IDAKLU with output variables, and corresponding examples, tests.
22+
- [#364](https://github.com/pybop-team/PyBOP/pull/364) - Adds the MultiFittingProblem class and the multi_fitting example script.
23+
- [#444](https://github.com/pybop-team/PyBOP/issues/444) - Merge `BaseModel` `build()` and `rebuild()` functionality.
24+
- [#435](https://github.com/pybop-team/PyBOP/pull/435) - Adds SLF001 linting for private members.
25+
- [#418](https://github.com/pybop-team/PyBOP/issues/418) - Wraps the `get_parameter_info` method from PyBaMM to get a dictionary of parameter names and types.
26+
- [#413](https://github.com/pybop-team/PyBOP/pull/413) - Adds `DesignCost` functionality to `WeightedCost` class with additional tests.
27+
- [#357](https://github.com/pybop-team/PyBOP/pull/357) - Adds `Transformation()` class with `LogTransformation()`, `IdentityTransformation()`, and `ScaledTransformation()`, `ComposedTransformation()` implementations with corresponding examples and tests.
28+
- [#427](https://github.com/pybop-team/PyBOP/issues/427) - Adds the nbstripout pre-commit hook to remove unnecessary metadata from notebooks.
29+
- [#327](https://github.com/pybop-team/PyBOP/issues/327) - Adds the `WeightedCost` subclass, defines when to evaluate a problem and adds the `spm_weighted_cost` example script.
30+
- [#393](https://github.com/pybop-team/PyBOP/pull/383) - Adds Minkowski and SumofPower cost classes, with an example and corresponding tests.
31+
- [#403](https://github.com/pybop-team/PyBOP/pull/403/) - Adds lychee link checking action.
32+
33+
## Bug Fixes
34+
35+
- [#473](https://github.com/pybop-team/PyBOP/pull/473) - Bugfixes for transformation class, adds optional `apply_transform` arg to `BaseCost.__call__()`, adds `log_update()` method to `BaseOptimiser`
36+
- [#464](https://github.com/pybop-team/PyBOP/issues/464) - Fix order of design `parameter_set` updates and refactor `update_capacity`.
37+
- [#468](https://github.com/pybop-team/PyBOP/issue/468) - Renames `quick_plot.py` to `standard_plots.py`.
38+
- [#454](https://github.com/pybop-team/PyBOP/issue/454) - Fixes benchmarking suite.
39+
- [#421](https://github.com/pybop-team/PyBOP/issues/421) - Adds a default value for the initial SOC for design problems.
40+
41+
## Breaking Changes
42+
43+
- [#483](https://github.com/pybop-team/PyBOP/pull/483) - Replaces `pybop.MAP` with `pybop.LogPosterior` with an updated call args and bugfixes.
44+
- [#436](https://github.com/pybop-team/PyBOP/pull/436) - **API Change:** The functionality from `BaseCost.evaluate/S1` & `BaseCost._evaluate/S1` is represented in `BaseCost.__call__` & `BaseCost.compute`. `BaseCost.compute` directly acts on the predictions, while `BaseCost.__call__` calls `BaseProblem.evaluate/S1` before `BaseCost.compute`. `compute` has optional args for gradient cost calculations.
45+
- [#424](https://github.com/pybop-team/PyBOP/issues/424) - Replaces the `init_soc` input to `FittingProblem` with the option to pass an initial OCV value, updates `BaseModel` and fixes `multi_model_identification.ipynb` and `spm_electrode_design.ipynb`.
46+
947
# [v24.6.1](https://github.com/pybop-team/PyBOP/tree/v24.6.1) - 2024-07-31
1048

1149
## Features
50+
1251
- [#313](https://github.com/pybop-team/PyBOP/pull/313/) - Fixes for PyBaMM v24.5, drops support for PyBaMM v23.9, v24.1
1352

1453
## Bug Fixes
1554

16-
1755
## Breaking Changes
1856

1957
# [v24.6](https://github.com/pybop-team/PyBOP/tree/v24.6) - 2024-07-08

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ authors:
1111
family-names: Courtier
1212
- given-names: David
1313
family-names: Howey
14-
version: "24.6.1" # Update this when you release a new version
14+
version: "24.9.0" # Update this when you release a new version
1515
repository-code: 'https://www.github.com/pybop-team/pybop'

CONTRIBUTING.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pip install -e .[all,dev]
2121

2222
Before you commit any code, please perform the following checks using [Nox](https://nox.thea.codes/en/stable/index.html):
2323

24-
- [All tests pass](#testing): `$ nox -s unit`
24+
- [All tests pass](#testing): `$ nox -s quick`
2525

2626
### Installing and using pre-commit
2727

@@ -62,9 +62,9 @@ You now have everything you need to start making changes!
6262

6363
### B. Writing your code
6464

65-
6. PyBOP is developed in [Python](https://en.wikipedia.org/wiki/Python_(programming_language)), and makes heavy use of [NumPy](https://en.wikipedia.org/wiki/NumPy) (see also [NumPy for MatLab users](https://numpy.org/doc/stable/user/numpy-for-matlab-users.html) and [Python for R users](http://blog.hackerearth.com/how-can-r-users-learn-python-for-data-science)).
65+
6. PyBOP is developed in [Python](https://en.wikipedia.org/wiki/Python_(programming_language)), and makes heavy use of [NumPy](https://en.wikipedia.org/wiki/NumPy) (see also [NumPy for MatLab users](https://numpy.org/doc/stable/user/numpy-for-matlab-users.html) and [Python for R users](https://rebeccabarter.com/blog/2023-09-11-from_r_to_python)).
6666
7. Make sure to follow our [coding style guidelines](#coding-style-guidelines).
67-
8. Commit your changes to your branch with [useful, descriptive commit messages](https://chris.beams.io/posts/git-commit/): Remember these are publicly visible and should still make sense a few months ahead in time. While developing, you can keep using the GitHub issue you're working on as a place for discussion. [Refer to your commits](https://stackoverflow.com/questions/8910271/how-can-i-reference-a-commit-in-an-issue-comment-on-github) when discussing specific lines of code.
67+
8. Commit your changes to your branch with [useful, descriptive commit messages](https://chris.beams.io/posts/git-commit/): Remember these are publicly visible and should still make sense a few months ahead in time. While developing, you can keep using the GitHub issue you're working on as a place for discussion. Refer to your commits when discussing specific lines of code. This is achieved by referencing the SHA-hash in the comment. An example of this looks like: `the commit 3e5c1e6 solved the issue...`
6868
9. If you want to add a dependency on another library, or re-use code you found somewhere else, have a look at [these guidelines](#dependencies-and-reusing-code).
6969

7070
### C. Merging your changes with PyBOP
@@ -83,16 +83,20 @@ PyBOP follows the [PEP8 recommendations](https://www.python.org/dev/peps/pep-000
8383

8484
### Ruff
8585

86-
We use [ruff](https://github.com/charliermarsh/ruff) to check our PEP8 adherence. To try this on your system, navigate to the PyBOP directory in a console and type
86+
We use [ruff](https://github.com/charliermarsh/ruff) to lint and ensure adherence to Python PEP standards. To manually trigger `ruff`, navigate to the PyBOP directory in a console and type
8787

8888
```bash
8989
python -m pip install pre-commit
9090
pre-commit run ruff
9191
```
9292

93-
ruff is configured inside the file `pre-commit-config.yaml`, allowing us to ignore some errors. If you think this should be added or removed, please submit an [issue](https://guides.github.com/features/issues/).
93+
ruff is configured inside the file `pyproject.toml`, allowing us to ignore some errors. If you think a rule should be added or removed, please submit an [issue](https://guides.github.com/features/issues/).
9494

95-
When you commit your changes they will be checked against ruff automatically (see [Pre-commit checks](#pre-commit-checks)).
95+
When you commit your changes they will be checked against ruff automatically (see [Pre-commit checks](#pre-commit-checks)). If you are having issues getting your commit to pass the linting, it
96+
is possible to skip linting for single lines (this should only be done as a **last resort**) by adding a line comment of `#noqa: $ruff_rule` where the `$ruff_rule` is replaced with the rule in question.
97+
It is also possible to skip linting altogether by committing your changes by using the
98+
`--no-verify` command-line flag.
99+
These rules can be found in the ruff configuration in `pyproject.toml` or in the failed pre-commit output. Please note the lint skipping in the pull request for reviewers.
96100

97101
### Naming
98102

@@ -105,7 +109,7 @@ Class names are CamelCase, and start with an upper case letter, for example `MyO
105109
While it's a bad idea for developers to "reinvent the wheel", it's important for users to get a _reasonably sized download and an easy install_. In addition, external libraries can sometimes cease to be supported, and when they contain bugs it might take a while before fixes become available as automatic downloads to PyBOP users.
106110
For these reasons, all dependencies in PyBOP should be thought about carefully and discussed on GitHub.
107111

108-
Direct inclusion of code from other packages is possible, as long as their license permits it and is compatible with ours, but again should be considered carefully and discussed in the group. Snippets from blogs and [stackoverflow](https://stackoverflow.com/) can often be included but must include attribution to the original by commenting with a link in the source code.
112+
Direct inclusion of code from other packages is possible, as long as their license permits it and is compatible with ours, but again should be considered carefully and discussed in the group. Snippets from blogs and stackoverflow can often be included but must include attribution to the original by commenting with a link in the source code.
109113

110114
### Separating dependencies
111115

0 commit comments

Comments
 (0)