Skip to content

Commit 6487bf1

Browse files
authored
Merge pull request #395 from pybop-team/v24.6
v24.6
2 parents 2a588e0 + 37a12bf commit 6487bf1

File tree

144 files changed

+23936
-4663
lines changed

Some content is hidden

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

144 files changed

+23936
-4663
lines changed

.all-contributorsrc

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,25 @@
6161
"avatar_url": "https://avatars.githubusercontent.com/u/28443643?v=4",
6262
"profile": "https://www.brosaplanella.xyz",
6363
"contributions": [
64+
"review",
65+
"code"
66+
]
67+
},
68+
{
69+
"login": "agriyakhetarpal",
70+
"name": "Agriya Khetarpal",
71+
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
72+
"profile": "https://github.com/agriyakhetarpal",
73+
"contributions": [
74+
"code",
75+
"infra",
6476
"review"
6577
]
6678
},
6779
{
6880
"login": "FaradayInstitution",
6981
"name": "Faraday Institution",
70-
"avatar_url": "/assets/UKRI.svg",
82+
"avatar_url": "assets/faraday-logo.jpg",
7183
"profile": "https://faraday.ac.uk",
7284
"contributions": [
7385
"financial"
@@ -76,20 +88,28 @@
7688
{
7789
"login": "UKRI",
7890
"name": "UK Research and Innovation",
79-
"avatar_url": "/assets/UKRI.svg",
91+
"avatar_url": "assets/UKRI.png",
8092
"profile": "https://www.ukri.org/",
8193
"contributions": [
8294
"financial"
8395
]
8496
},
8597
{
86-
"login": "agriyakhetarpal",
87-
"name": "Agriya Khetarpal",
88-
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
89-
"profile": "https://github.com/agriyakhetarpal",
98+
"login": "IntelLiGent",
99+
"name": "Horizon Europe IntelLiGent Consortium",
100+
"avatar_url": "assets/logo-farger.pdf",
101+
"profile": "https://heuintelligent.eu/",
90102
"contributions": [
91-
"code",
92-
"infra"
103+
"financial"
104+
]
105+
},
106+
{
107+
"login": "muhammedsogut",
108+
"name": "Muhammed Nedim Sogut",
109+
"avatar_url": "https://avatars.githubusercontent.com/u/34511375?v=4",
110+
"profile": "https://www.linkedin.com/in/muhammedsogut/",
111+
"contributions": [
112+
"code"
93113
]
94114
}
95115
],

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Before you mark your PR as ready for review, please ensure that you've considere
1313
## Type of change
1414
- [ ] New Feature: A non-breaking change that adds new functionality.
1515
- [ ] Optimization: A code change that improves performance.
16+
- [ ] Examples: A change to existing or additional examples.
1617
- [ ] Bug Fix: A non-breaking change that addresses an issue.
1718
- [ ] Documentation: Updates to documentation or new documentation for new features.
1819
- [ ] Refactoring: Non-functional changes that improve the codebase.
@@ -24,7 +25,7 @@ Before you mark your PR as ready for review, please ensure that you've considere
2425

2526
- [ ] 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)
2627
- [ ] All unit tests pass: `$ nox -s tests`
27-
- [ ] The documentation builds: `$ nox -s docs`
28+
- [ ] The documentation builds: `$ nox -s doctest`
2829

2930
You can run integration tests, unit tests, and doctests together at once, using `$ nox -s quick`.
3031

.github/release_workflow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ To create a new release, follow these steps:
99
1. **Prepare the Release:**
1010
- Create a new branch for the release (i.e. `v24.XX`) from `develop`.
1111
- Increment the following;
12-
- The version number in the `pyproject.toml` file following CalVer versioning.
12+
- The version number in the `pyproject.toml` and `CITATION.cff` files following CalVer versioning.
1313
- The`CHANGELOG.md` version with the changes for the new version.
14+
- Add a new entry for the documentation site version switcher located at `docs/_static/switcher.json`
1415
- Open a PR to the `main` branch. Once the PR is merged, proceed to the next step.
1516

1617
2. **Tag the Release:**
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Nightly dependencies at develop
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 23 * * 1"
7+
8+
concurrency:
9+
# github.workflow: name of the workflow, so that we don't cancel other workflows
10+
# github.run_id || github.event_name: either the unique identifier for the job or the event that triggered it
11+
group: ${{ github.workflow }}-${{ github.run_id || github.event_name }}
12+
# Cancel in-progress runs when a new workflow with the same group name is triggered
13+
cancel-in-progress: true
14+
15+
jobs:
16+
nightly_tests:
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, macos-14]
22+
python-version: ["3.12"]
23+
suite: ["unit", "integration", "examples"]
24+
25+
name: Test-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.suite }})
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install -e .[all,dev]
36+
python -m pip uninstall -y pybamm
37+
python -m pip install "pybamm[all] @ git+https://github.com/pybamm-team/PyBaMM@develop"
38+
39+
40+
- name: Run ${{ matrix.suite }} tests
41+
run: |
42+
if [[ "${{ matrix.suite }}" == "unit" ]]; then
43+
python -m pytest --unit
44+
elif [[ "${{ matrix.suite }}" == "integration" ]]; then
45+
python -m pytest --integration
46+
elif [[ "${{ matrix.suite }}" == "examples" ]]; then
47+
python -m pytest --nbmake --examples
48+
fi

.github/workflows/periodic_benchmarks.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
# - Publish website
1111
name: Benchmarks
1212
on:
13-
# Everyday at 12 pm UTC
13+
# Every Monday and Thursday at 12 pm UTC
1414
schedule:
15-
- cron: "0 12 * * *"
15+
- cron: "0 12 * * 1,4"
1616
# Make it possible to trigger the
1717
# workflow manually
1818
workflow_dispatch:
@@ -22,6 +22,11 @@ jobs:
2222
runs-on: [self-hosted, macOS, ARM64]
2323
if: github.repository == 'pybop-team/PyBOP'
2424
steps:
25+
- name: Cleanup build folder
26+
run: |
27+
rm -rf ./* || true
28+
rm -rf ./.??* || true
29+
2530
- uses: actions/checkout@v4
2631

2732
- name: Install python & create virtualenv

.github/workflows/release_action.yaml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ jobs:
1616
uses: actions/setup-python@v4
1717
with:
1818
python-version: "3.12"
19-
- name: Install pypa/build
20-
run: >-
21-
python3 -m
22-
pip install
23-
build
24-
--user
25-
- name: Build a binary wheel and a source tarball
26-
run: python -m build
19+
- name: Build a source tarball and a wheel from it
20+
run: pipx run build
2721
- name: Store the distribution packages
2822
uses: actions/upload-artifact@v3
2923
with:
@@ -77,20 +71,17 @@ jobs:
7771
inputs: >-
7872
./dist/*.tar.gz
7973
./dist/*.whl
80-
- name: Upload artifact signatures to GitHub Release
81-
env:
82-
GITHUB_TOKEN: ${{ github.token }}
83-
# Upload to GitHub Release using the `gh` CLI.
84-
# `dist/` contains the built packages, and the
85-
# sigstore-produced signatures and certificates.
86-
run: >-
87-
gh release upload
88-
'${{ github.ref_name }}' dist/**
89-
--repo '${{ github.repository }}'
74+
- name: Publish artifacts and signatures to GitHub Releases
75+
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
76+
with:
77+
# `dist/` contains the built packages, and the
78+
# sigstore-produced signatures and certificates.
79+
files: dist/*
9080

9181
publish-to-testpypi:
9282
name: Publish Python 🐍 distribution 📦 to TestPyPI
93-
if: contains(github.ref, 'rc') && github.repository == github.event.repository # only publish to TestPyPI for rc tags
83+
# only publish to TestPyPI for rc tags
84+
if: contains(github.ref, 'rc') && github.repository == 'pybop-team/PyBOP'
9485
needs:
9586
- build
9687
runs-on: ubuntu-latest

.github/workflows/scheduled_tests.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ on:
66
branches:
77
- main
88

9-
# runs every day at 09:00 and 15:00 UTC
9+
# runs every day at 09:00 UTC
1010
schedule:
1111
- cron: '0 9 * * *'
12-
- cron: '0 15 * * *'
1312

1413
# Check noxfile.py for associated environment variables
1514
env:
@@ -35,10 +34,12 @@ jobs:
3534
outputs:
3635
pybop_matrix: ${{ steps.set-matrix.outputs.matrix }}
3736

38-
# filter the matrix to only include the macOS-latest entries
37+
# Filter the matrix to only include Python and PyBaMM versions. This job
38+
# is used for the self-hosted macOS-14 (arm64) runner at this time.
3939
filter_pybamm_matrix:
40-
name: Filter the matrix for macOS-latest entries
40+
name: Filter the matrix for OS and Python version
4141
needs: [create_pybamm_matrix]
42+
if: github.repository == 'pybop-team/PyBOP'
4243
runs-on: ubuntu-latest
4344
outputs:
4445
filtered_pybop_matrix: ${{ steps.set-matrix.outputs.matrix }}
@@ -53,8 +54,12 @@ jobs:
5354
matrix_json = '${{ needs.create_pybamm_matrix.outputs.pybop_matrix }}'
5455
matrix = json.loads(matrix_json)
5556
56-
# Filter the matrix for macOS-latest entries only
57-
filtered_entries = [entry for entry in matrix['include'] if entry['os'] == 'macos-latest']
57+
# Filter the matrix to include just the Python version and PyBaMM version
58+
# First filter the matrix to only include macOS-14 entries
59+
filtered_entries = [entry for entry in matrix['include'] if entry['os'] == 'macos-14']
60+
# Then remove the os key from the entries
61+
for entry in filtered_entries:
62+
entry.pop('os')
5863
filtered_matrix = {'include': filtered_entries}
5964
6065
# Set the output variable for other jobs to use
@@ -63,6 +68,8 @@ jobs:
6368
output_stream.write(f"matrix={json.dumps(filtered_matrix)}\n")
6469
shell: python
6570

71+
# This job is dependent on filter_pybamm_matrix so that the self-hosted runner starts
72+
# as soon as the matrix is filtered (i.e. the runners don't get tied up with build below).
6673
build:
6774
needs: [create_pybamm_matrix, filter_pybamm_matrix]
6875
name: Build (${{ matrix.os }}, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
@@ -82,16 +89,18 @@ jobs:
8289

8390
- name: Install dependencies
8491
run: |
85-
python -m pip install --upgrade pip nox
92+
python -m pip install --upgrade pip nox[uv]
8693
8794
- name: Unit tests with nox
8895
run: python -m nox -s coverage
8996

90-
- name: Run notebooks with nox
91-
run: python -m nox -s notebooks
97+
- name: Run examples with nox
98+
run: python -m nox -s examples
9299

93100
# M-series Mac Mini
94101
build-apple-mseries:
102+
# This job filters the matrix JSON created in build_matrix.sh to provide
103+
# a matrix of only macOS-14 (arm64) entries
95104
needs: [filter_pybamm_matrix]
96105
name: Build (MacOS M-series, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
97106
runs-on: [self-hosted, macOS, ARM64]
@@ -104,6 +113,11 @@ jobs:
104113
matrix: ${{fromJson(needs.filter_pybamm_matrix.outputs.filtered_pybop_matrix)}}
105114

106115
steps:
116+
- name: Cleanup build folder
117+
run: |
118+
rm -rf ./* || true
119+
rm -rf ./.??* || true
120+
107121
- uses: actions/checkout@v4
108122
- name: Install python & create virtualenv
109123
shell: bash
@@ -112,14 +126,14 @@ jobs:
112126
pyenv install ${{ matrix.python_version }} -s
113127
pyenv virtualenv ${{ matrix.python_version }} pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
114128
115-
- name: Install dependencies & run unit + notebook tests
129+
- name: Install dependencies & run tests
116130
shell: bash
117131
run: |
118132
eval "$(pyenv init -)"
119133
pyenv activate pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
120-
python -m pip install --upgrade pip nox
134+
python -m pip install --upgrade pip nox[uv]
121135
python -m nox -s coverage
122-
python -m nox -s notebooks
136+
python -m nox -s examples
123137
124138
- name: Uninstall pyenv-virtualenv & python
125139
if: always()

0 commit comments

Comments
 (0)