Skip to content

Commit

Permalink
Merge pull request #395 from pybop-team/v24.6
Browse files Browse the repository at this point in the history
v24.6
  • Loading branch information
BradyPlanden authored Jul 8, 2024
2 parents 2a588e0 + 37a12bf commit 6487bf1
Show file tree
Hide file tree
Showing 144 changed files with 23,936 additions and 4,663 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
3 changes: 2 additions & 1 deletion .github/release_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ 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.
- Add a new entry for the documentation site version switcher located at `docs/_static/switcher.json`
- Open a PR to the `main` branch. Once the PR is merged, proceed to the next step.

2. **Tag the Release:**
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
9 changes: 7 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 All @@ -22,6 +22,11 @@ jobs:
runs-on: [self-hosted, macOS, ARM64]
if: github.repository == 'pybop-team/PyBOP'
steps:
- name: Cleanup build folder
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- uses: actions/checkout@v4

- name: Install python & create virtualenv
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
38 changes: 26 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 @@ -104,6 +113,11 @@ jobs:
matrix: ${{fromJson(needs.filter_pybamm_matrix.outputs.filtered_pybop_matrix)}}

steps:
- name: Cleanup build folder
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- uses: actions/checkout@v4
- name: Install python & create virtualenv
shell: bash
Expand All @@ -112,14 +126,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
Loading

0 comments on commit 6487bf1

Please sign in to comment.