Skip to content

Commit

Permalink
Merge branch 'develop' into v24.3.1_into_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyPlanden authored Jun 18, 2024
2 parents 2a588e0 + 4dfdd1d commit 025d60f
Show file tree
Hide file tree
Showing 112 changed files with 21,037 additions and 4,189 deletions.
36 changes: 28 additions & 8 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,25 @@
"avatar_url": "https://avatars.githubusercontent.com/u/28443643?v=4",
"profile": "https://www.brosaplanella.xyz",
"contributions": [
"review",
"code"
]
},
{
"login": "agriyakhetarpal",
"name": "Agriya Khetarpal",
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
"profile": "https://github.com/agriyakhetarpal",
"contributions": [
"code",
"infra",
"review"
]
},
{
"login": "FaradayInstitution",
"name": "Faraday Institution",
"avatar_url": "/assets/UKRI.svg",
"avatar_url": "assets/faraday-logo.jpg",
"profile": "https://faraday.ac.uk",
"contributions": [
"financial"
Expand All @@ -76,20 +88,28 @@
{
"login": "UKRI",
"name": "UK Research and Innovation",
"avatar_url": "/assets/UKRI.svg",
"avatar_url": "assets/UKRI.png",
"profile": "https://www.ukri.org/",
"contributions": [
"financial"
]
},
{
"login": "agriyakhetarpal",
"name": "Agriya Khetarpal",
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
"profile": "https://github.com/agriyakhetarpal",
"login": "IntelLiGent",
"name": "Horizon Europe IntelLiGent Consortium",
"avatar_url": "assets/logo-farger.pdf",
"profile": "https://heuintelligent.eu/",
"contributions": [
"code",
"infra"
"financial"
]
},
{
"login": "muhammedsogut",
"name": "Muhammed Nedim Sogut",
"avatar_url": "https://avatars.githubusercontent.com/u/34511375?v=4",
"profile": "https://www.linkedin.com/in/muhammedsogut/",
"contributions": [
"code"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Before you mark your PR as ready for review, please ensure that you've considere
## Type of change
- [ ] New Feature: A non-breaking change that adds new functionality.
- [ ] Optimization: A code change that improves performance.
- [ ] Examples: A change to existing or additional examples.
- [ ] Bug Fix: A non-breaking change that addresses an issue.
- [ ] Documentation: Updates to documentation or new documentation for new features.
- [ ] Refactoring: Non-functional changes that improve the codebase.
Expand All @@ -24,7 +25,7 @@ Before you mark your PR as ready for review, please ensure that you've considere

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

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

Expand Down
2 changes: 1 addition & 1 deletion .github/release_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To create a new release, follow these steps:
1. **Prepare the Release:**
- Create a new branch for the release (i.e. `v24.XX`) from `develop`.
- Increment the following;
- The version number in the `pyproject.toml` file following CalVer versioning.
- The version number in the `pyproject.toml` and `CITATION.cff` files following CalVer versioning.
- The`CHANGELOG.md` version with the changes for the new version.
- Open a PR to the `main` branch. Once the PR is merged, proceed to the next step.

Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/nightly_dependency_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Nightly dependencies at develop

on:
workflow_dispatch:
schedule:
- cron: "0 23 * * 1"

concurrency:
# github.workflow: name of the workflow, so that we don't cancel other workflows
# github.run_id || github.event_name: either the unique identifier for the job or the event that triggered it
group: ${{ github.workflow }}-${{ github.run_id || github.event_name }}
# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true

jobs:
nightly_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
python-version: ["3.12"]
suite: ["unit", "integration", "examples"]

name: Test-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.suite }})

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .[all,dev]
python -m pip uninstall -y pybamm
python -m pip install "pybamm[all] @ git+https://github.com/pybamm-team/PyBaMM@develop"
- name: Run ${{ matrix.suite }} tests
run: |
if [[ "${{ matrix.suite }}" == "unit" ]]; then
python -m pytest --unit
elif [[ "${{ matrix.suite }}" == "integration" ]]; then
python -m pytest --integration
elif [[ "${{ matrix.suite }}" == "examples" ]]; then
python -m pytest --nbmake --examples
fi
4 changes: 2 additions & 2 deletions .github/workflows/periodic_benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
# - Publish website
name: Benchmarks
on:
# Everyday at 12 pm UTC
# Every Monday and Thursday at 12 pm UTC
schedule:
- cron: "0 12 * * *"
- cron: "0 12 * * 1,4"
# Make it possible to trigger the
# workflow manually
workflow_dispatch:
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/release_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Build a source tarball and a wheel from it
run: pipx run build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -77,20 +71,17 @@ jobs:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
- name: Publish artifacts and signatures to GitHub Releases
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
with:
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
files: dist/*

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: contains(github.ref, 'rc') && github.repository == github.event.repository # only publish to TestPyPI for rc tags
# only publish to TestPyPI for rc tags
if: contains(github.ref, 'rc') && github.repository == 'pybop-team/PyBOP'
needs:
- build
runs-on: ubuntu-latest
Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ on:
branches:
- main

# runs every day at 09:00 and 15:00 UTC
# runs every day at 09:00 UTC
schedule:
- cron: '0 9 * * *'
- cron: '0 15 * * *'

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

# filter the matrix to only include the macOS-latest entries
# Filter the matrix to only include Python and PyBaMM versions. This job
# is used for the self-hosted macOS-14 (arm64) runner at this time.
filter_pybamm_matrix:
name: Filter the matrix for macOS-latest entries
name: Filter the matrix for OS and Python version
needs: [create_pybamm_matrix]
if: github.repository == 'pybop-team/PyBOP'
runs-on: ubuntu-latest
outputs:
filtered_pybop_matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -53,8 +54,12 @@ jobs:
matrix_json = '${{ needs.create_pybamm_matrix.outputs.pybop_matrix }}'
matrix = json.loads(matrix_json)
# Filter the matrix for macOS-latest entries only
filtered_entries = [entry for entry in matrix['include'] if entry['os'] == 'macos-latest']
# Filter the matrix to include just the Python version and PyBaMM version
# First filter the matrix to only include macOS-14 entries
filtered_entries = [entry for entry in matrix['include'] if entry['os'] == 'macos-14']
# Then remove the os key from the entries
for entry in filtered_entries:
entry.pop('os')
filtered_matrix = {'include': filtered_entries}
# Set the output variable for other jobs to use
Expand All @@ -63,6 +68,8 @@ jobs:
output_stream.write(f"matrix={json.dumps(filtered_matrix)}\n")
shell: python

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
python -m pip install --upgrade pip nox[uv]
- name: Unit tests with nox
run: python -m nox -s coverage

- name: Run notebooks with nox
run: python -m nox -s notebooks
- name: Run examples with nox
run: python -m nox -s examples

# M-series Mac Mini
build-apple-mseries:
# This job filters the matrix JSON created in build_matrix.sh to provide
# a matrix of only macOS-14 (arm64) entries
needs: [filter_pybamm_matrix]
name: Build (MacOS M-series, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
runs-on: [self-hosted, macOS, ARM64]
Expand All @@ -112,14 +121,14 @@ jobs:
pyenv install ${{ matrix.python_version }} -s
pyenv virtualenv ${{ matrix.python_version }} pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
- name: Install dependencies & run unit + notebook tests
- name: Install dependencies & run tests
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
python -m pip install --upgrade pip nox
python -m pip install --upgrade pip nox[uv]
python -m nox -s coverage
python -m nox -s notebooks
python -m nox -s examples
- name: Uninstall pyenv-virtualenv & python
if: always()
Expand Down
50 changes: 20 additions & 30 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyBOP
name: Pull Request

on:
workflow_dispatch:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ["3.12"]

name: Integration tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
Expand All @@ -46,7 +46,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
python -m pip install --upgrade pip nox[uv]
- name: Integration tests
run: |
Expand All @@ -58,17 +58,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude: # We run the coverage tests on Ubuntu with Python 3.12
- os: ubuntu-latest
python-version: "3.12"
# Include MacOS M-series Runners
include:
- os: macos-14
python-version: "3.10"
- os: macos-14
python-version: "3.11"
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ["3.9", "3.10", "3.11", "3.12"]
exclude: # We run the coverage tests on macos-14 with Python 3.12
- os: macos-14
python-version: "3.12"

Expand All @@ -82,7 +74,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
python -m pip install --upgrade pip nox[uv]
- name: Unit tests
run: |
Expand All @@ -94,7 +86,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-14]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ["3.12"]

name: Test examples (${{ matrix.os }} / Python ${{ matrix.python-version }})
Expand All @@ -107,23 +99,19 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
python -m pip install --upgrade pip nox[uv]
- name: Run examples
run: |
nox -s examples
- name: Run notebooks
run: |
nox -s notebooks
# Runs only on Ubuntu with Python 3.12
# Runs only on macos-14 with Python 3.12
check_coverage:
needs: style
runs-on: ubuntu-latest
runs-on: macos-14
strategy:
fail-fast: false
name: Coverage tests (ubuntu-latest / Python 3.12)
name: Coverage tests (macos-14 / Python 3.12)

steps:
- name: Check out PyBOP repository
Expand All @@ -137,12 +125,14 @@ jobs:
cache-dependency-path: setup.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
- name: Run coverage tests for Ubuntu with Python 3.12 and generate report
run: python -m pip install --upgrade pip nox[uv]

- name: Run coverage tests for macos-14 with Python 3.12 and generate report
run: nox -s coverage

- name: Upload coverage report
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 025d60f

Please sign in to comment.