Skip to content

Commit

Permalink
Merge branch 'develop' into 295-add-adamw-optimiser
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyPlanden committed May 8, 2024
2 parents a454c12 + 490273b commit c04f0f0
Show file tree
Hide file tree
Showing 28 changed files with 13,824 additions and 2,177 deletions.
3 changes: 2 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"avatar_url": "https://avatars.githubusercontent.com/u/28443643?v=4",
"profile": "https://www.brosaplanella.xyz",
"contributions": [
"review"
"review",
"code"
]
},
{
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,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 +55,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 @@ -64,7 +70,7 @@ jobs:
shell: python

build:
needs: [create_pybamm_matrix, filter_pybamm_matrix]
needs: [create_pybamm_matrix]
name: Build (${{ matrix.os }}, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -82,7 +88,7 @@ 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
Expand All @@ -92,6 +98,8 @@ jobs:

# 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 @@ -117,7 +125,7 @@ jobs:
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 examples
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip "nox[uv]"
python -m pip install --upgrade pip nox[uv]
- name: Integration tests
run: |
Expand All @@ -58,19 +58,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
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 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: macos-14
python-version: "3.12"

name: Unit tests (${{ matrix.os }} / Python ${{ matrix.python-version }})

Expand Down Expand Up @@ -133,8 +125,8 @@ jobs:
cache-dependency-path: setup.py

- name: Install dependencies
run: |
python -m pip install --upgrade pip "nox[uv]"
run: python -m pip install --upgrade pip nox[uv]

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

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.7"
rev: "v0.4.3"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Features


- [#301](https://github.com/pybop-team/PyBOP/pull/301) - Updates default echem solver to "fast with events" mode.
- [#251](https://github.com/pybop-team/PyBOP/pull/251) - Increment PyBaMM > v23.5, remove redundant tests within integration tests, increment citation version, fix examples with incorrect model definitions.
- [#285](https://github.com/pybop-team/PyBOP/pull/285) - Drop support for Python 3.8.
- [#275](https://github.com/pybop-team/PyBOP/pull/275) - Adds Maximum a Posteriori (MAP) cost function with corresponding tests.
Expand All @@ -17,6 +17,8 @@ codesigned binaries and source distributions via `sigstore-python`.

## Bug Fixes

- [#308](https://github.com/pybop-team/PyBOP/pull/308) - Enables testing on both macOS Intel and macOS ARM (Silicon) runners and fixes the scheduled tests.
- [#299](https://github.com/pybop-team/PyBOP/pull/299) - Bugfix multiprocessing support for Linux, MacOS, Windows (WSL) and improves coverage.
- [#270](https://github.com/pybop-team/PyBOP/pull/270) - Updates PR template.
- [#91](https://github.com/pybop-team/PyBOP/issues/91) - Adds a check on the number of parameters for CMAES and makes XNES the default optimiser.

Expand Down
Loading

0 comments on commit c04f0f0

Please sign in to comment.