Skip to content

Commit 9e9c067

Browse files
authored
Merge pull request #156 from pybop-team/v23.12
Make release v23.12
2 parents 6e5c007 + c0eb5a6 commit 9e9c067

Some content is hidden

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

84 files changed

+4826
-1080
lines changed

.all-contributorsrc

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"infra",
1717
"test",
1818
"code",
19-
"example"
19+
"example",
20+
"review"
2021
]
2122
},
2223
{
@@ -26,7 +27,9 @@
2627
"profile": "https://github.com/NicolaCourtier",
2728
"contributions": [
2829
"code",
29-
"review"
30+
"review",
31+
"example",
32+
"test"
3033
]
3134
},
3235
{
@@ -46,7 +49,35 @@
4649
"profile": "http://www.rse.ox.ac.uk",
4750
"contributions": [
4851
"ideas",
49-
"mentoring"
52+
"mentoring",
53+
"review"
54+
]
55+
},
56+
{
57+
"login": "brosaplanella",
58+
"name": "Ferran Brosa Planella",
59+
"avatar_url": "https://avatars.githubusercontent.com/u/28443643?v=4",
60+
"profile": "https://www.brosaplanella.xyz",
61+
"contributions": [
62+
"review"
63+
]
64+
},
65+
{
66+
"login": "FaradayInstitution",
67+
"name": "Faraday Institution",
68+
"avatar_url": "/assets/UKRI.svg",
69+
"profile": "https://faraday.ac.uk",
70+
"contributions": [
71+
"financial"
72+
]
73+
},
74+
{
75+
"login": "UKRI",
76+
"name": "UK Research and Innovation",
77+
"avatar_url": "/assets/UKRI.svg",
78+
"profile": "https://www.ukri.org/",
79+
"contributions": [
80+
"financial"
5081
]
5182
}
5283
],

.github/workflows/release-action.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
22

3-
on: push
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published, prereleased]
47

58
jobs:
69
build:
@@ -30,7 +33,9 @@ jobs:
3033
publish-to-pypi:
3134
name: >-
3235
Publish Python 🐍 distribution 📦 to PyPI
33-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
36+
if: >
37+
startsWith(github.ref, 'refs/tags/') &&
38+
!contains(github.ref, 'rc')
3439
needs:
3540
- build
3641
runs-on: ubuntu-latest

.github/workflows/scheduled_tests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-latest
15+
runs-on: ${{ matrix.os }}
1616
strategy:
1717
fail-fast: false
1818
matrix:
19+
os: [ubuntu-latest, windows-latest, macos-latest]
1920
python-version: ["3.8", "3.9", "3.10", "3.11"]
2021

2122
steps:
@@ -32,7 +33,7 @@ jobs:
3233
python -m nox -s unit
3334
python -m nox -s notebooks
3435
35-
#M-series Mac Mini
36+
#M-series Mac Mini
3637
build-apple-mseries:
3738
runs-on: [self-hosted, macOS, ARM64]
3839
env:

.github/workflows/test_on_push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: test_on_push
22

33
on:
4-
push:
54
workflow_dispatch:
65
pull_request:
76

@@ -30,10 +29,11 @@ jobs:
3029
3130
3231
build:
33-
runs-on: ubuntu-latest
32+
runs-on: ${{ matrix.os }}
3433
strategy:
3534
fail-fast: false
3635
matrix:
36+
os: [ubuntu-latest, windows-latest, macos-latest]
3737
python-version: ["3.8", "3.9", "3.10", "3.11"]
3838

3939
steps:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ instance/
175175

176176
# Sphinx documentation
177177
docs/_build/
178+
docs/examples/generated/
179+
docs/api/
180+
warnings.txt
178181

179182
# PyBuilder
180183
.pybuilder/
@@ -304,3 +307,6 @@ $RECYCLE.BIN/
304307

305308
# Visual Studio Code settings
306309
.vscode/*
310+
311+
# Output JSON files
312+
**/fit_ecm_parameters.json

.pre-commit-config.yaml

Lines changed: 1 addition & 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.1.5"
7+
rev: "v0.1.7"
88
hooks:
99
- id: ruff
1010
args: [--fix, --show-fixes]

.readthedocs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
3+
build:
4+
os: ubuntu-20.04
5+
tools:
6+
python: "3.11"
7+
8+
# Build documentation in the "docs/" directory with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
formats:
13+
- htmlzip
14+
- pdf
15+
- epub
16+
17+
python:
18+
install:
19+
- method: pip
20+
path: .[docs]

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# [Unreleased](https://github.com/pybop-team/PyBOP)
2+
3+
## Features
4+
5+
## Bug Fixes
6+
7+
# [v23.12](https://github.com/pybop-team/PyBOP/tree/v23.12) - 2023-12-19
8+
## Features
9+
10+
- [#141](https://github.com/pybop-team/PyBOP/pull/141) - Adds documentation with Sphinx and PyData Sphinx Theme. Updates docstrings across package, relocates `costs` and `dataset` to top-level of package. Adds noxfile session and deployment workflow for docs.
11+
- [#131](https://github.com/pybop-team/PyBOP/issues/131) - Adds `SciPyDifferentialEvolution` optimiser, adds functionality for user-selectable maximum iteration limit to `SciPyMinimize`, `NLoptOptimize`, and `BaseOptimiser` classes.
12+
- [#107](https://github.com/pybop-team/PyBOP/issues/107) - Adds Equivalent Circuit Model (ECM) with examples, Import/Export parameter methods `ParameterSet.import_parameter` and `ParameterSet.export_parameters`, updates default FittingProblem.signal definition to `"Voltage [V]"`, and testing infrastructure
13+
- [#127](https://github.com/pybop-team/PyBOP/issues/127) - Adds Windows and macOS runners to the `test_on_push` action
14+
- [#114](https://github.com/pybop-team/PyBOP/issues/114) - Adds standard plotting class `pybop.StandardPlot()` via plotly backend
15+
- [#114](https://github.com/pybop-team/PyBOP/issues/114) - Adds `quick_plot()`, `plot_convergence()`, and `plot_cost2d()` methods
16+
- [#114](https://github.com/pybop-team/PyBOP/issues/114) - Adds a SciPy minimize example and logging for non-Pints optimisers
17+
- [#116](https://github.com/pybop-team/PyBOP/issues/116) - Adds PSO, SNES, XNES, ADAM, and IPropMin optimisers to PintsOptimisers() class
18+
- [#38](https://github.com/pybop-team/PyBOP/issues/38) - Restructures the Problem classes ahead of adding a design optimisation example
19+
- [#120](https://github.com/pybop-team/PyBOP/issues/120) - Updates the parameterisation test settings including the number of iterations
20+
- [#145](https://github.com/pybop-team/PyBOP/issues/145) - Reformats Dataset to contain a dictionary and signal into a list of strings
21+
22+
## Bug Fixes
23+
24+
# [v23.11](https://github.com/pybop-team/PyBOP/releases/tag/v23.11)
25+
- Initial release
26+
- Adds Pints, NLOpt, and SciPy optimisers
27+
- Adds SumofSquareError and RootMeanSquareError cost functions
28+
- Adds Parameter and Dataset classes

CITATION.cff

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

CONTRIBUTING.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
# Contributing to PyBOP
1+
# Contributing
22

3-
If you'd like to contribute to PyBOP, please have a look at the [pre-commit](#pre-commit-checks) and the [workflow](#workflow) guidelines below.
3+
If you'd like to contribute to PyBOP, please have a look at the guidelines below.
44

5+
## Developer-Installation
6+
7+
To install PyBOP for development purposes, which includes the testing and plotting dependencies, use the `[all]` flag as demonstrated below:
8+
9+
For `zsh`:
10+
11+
```sh
12+
pip install -e '.[all]'
13+
```
14+
For `bash`:
15+
```sh
16+
pip install -e .[all]
17+
```
518
## Pre-commit checks
619

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

922
- [All tests pass](#testing): `$ nox -s unit`
1023

@@ -17,7 +30,7 @@ pip install pre-commit
1730
pre-commit install
1831
```
1932

20-
This would run the checks every time a commit is created locally. The checks will only run on the files modified by that commit, but the checks can be triggered for all the files using -
33+
This would run the checks every time a commit is created locally. The checks will only run on the files modified by that commit, but the checks can be triggered for all the files using,
2134

2235
```bash
2336
pre-commit run --all-files
@@ -34,7 +47,7 @@ We use [GIT](https://en.wikipedia.org/wiki/Git) and [GitHub](https://en.wikipedi
3447
1. Create an [issue](https://guides.github.com/features/issues/) where new proposals can be discussed before any coding is done.
3548
2. Create a [branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) of this repo (ideally on your own [fork](https://help.github.com/articles/fork-a-repo/)), where all changes will be made
3649
3. Download the source code onto your local system, by [cloning](https://help.github.com/articles/cloning-a-repository/) the repository (or your fork of the repository).
37-
4. [Install](Developer-Install) PyBOP with the developer options.
50+
4. [Install](#developer-installation) PyBOP with the developer options.
3851
5. [Test](#testing) if your installation worked: `$ pytest --unit -v`.
3952

4053
You now have everything you need to start making changes!
@@ -69,7 +82,7 @@ python -m pip install pre-commit
6982
pre-commit run ruff
7083
```
7184

72-
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](#issues)
85+
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/).
7386

7487
When you commit your changes they will be checked against ruff automatically (see [Pre-commit checks](#pre-commit-checks)).
7588

@@ -113,6 +126,16 @@ def plot_great_things(self, x, y, z):
113126

114127
This allows people to (1) use PyBOP without ever importing Matplotlib and (2) configure Matplotlib's back-end in their scripts, which _must_ be done before e.g. `pyplot` is first imported.
115128

129+
### Building documentation
130+
131+
We use [Sphinx](http://www.sphinx-doc.org/en/stable/) to build our documentation. A [Nox](https://nox.thea.codes/en/stable/index.html) session has been created to reduce the overhead when building the documentation locally. To run this session, type
132+
133+
```bash
134+
nox -s docs
135+
```
136+
137+
This will build the docs using sphinx-autobuild and render them in your browser.
138+
116139
## Testing
117140

118141
All code requires testing. We use the [pytest](https://docs.pytest.org/en/) package for our tests. (These tests typically just check that the code runs without error, and so, are more _debugging_ than _testing_ in a strict sense. Nevertheless, they are very useful to have!)
@@ -123,7 +146,7 @@ If you have nox installed, to run unit tests, type
123146
nox -s unit
124147
```
125148

126-
else, type
149+
Alternatively, to run tests standalone with pytest, run,
127150

128151
```bash
129152
pytest --unit -v
@@ -270,7 +293,7 @@ Configuration files:
270293
setup.py
271294
```
272295

273-
Note that this file must be kept in sync with the version number in [pybop/**init**.py](pybop/__init__.py).
296+
Note that this file must be kept in sync with the version number in [pybop/**init**.py](https://github.com/pybop-team/PyBOP/blob/develop/pybop/__init__.py).
274297

275298
### Continuous Integration using GitHub actions
276299

@@ -293,11 +316,10 @@ Code coverage (how much of our code is seen by the (Linux) unit tests) is tested
293316

294317
GitHub does some magic with particular filenames. In particular:
295318

296-
- The first page people see when they go to [our GitHub page](https://github.com/pybop-team/PyBOP) displays the contents of [README.md](README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
297-
- The license for using PyBOP is stored in [LICENSE](LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
298-
- This file, [CONTRIBUTING.md](CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
319+
- The first page people see when they go to [our GitHub page](https://github.com/pybop-team/PyBOP) displays the contents of [README.md](https://github.com/pybop-team/PyBOP/blob/develop/README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
320+
- The license for using PyBOP is stored in [LICENSE](https://github.com/pybop-team/PyBOP/blob/develop/LICENSE), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
321+
- This file, [CONTRIBUTING.md](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
299322

300323
## Acknowledgements
301324

302-
This CONTRIBUTING.md file, along with large sections of the code infrastructure,
303-
was copied from the excellent [Pints repo](https://github.com/pints-team/pints), and [PyBaMM repo](https://github.com/pybamm-team/PyBaMM)
325+
This CONTRIBUTING.md file, along with large sections of the code infrastructure, was copied from the excellent [Pints repo](https://github.com/pints-team/pints), and [PyBaMM repo](https://github.com/pybamm-team/PyBaMM)

0 commit comments

Comments
 (0)