Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PyBaMM IDAKLU solver, compiled from source #217

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
51e7c3a
#12 initial sketch of observers with UKF as method
martinjrobins Dec 18, 2023
4d4a1fe
#12 some minor fixes
martinjrobins Dec 18, 2023
9d4f122
#12 remove unneeded type alias
martinjrobins Dec 18, 2023
6f25faf
#12 restructure a bit, base observer just observes...
martinjrobins Dec 19, 2023
fb57efe
#12 fixes for UKF
martinjrobins Dec 19, 2023
1d0bcf9
#12 UKF works ok
martinjrobins Dec 20, 2023
481b166
#12 dont reinit solver if we don't have to
martinjrobins Dec 20, 2023
8e880fe
Merge branch 'develop' into i12-unscented-kalman
martinjrobins Dec 20, 2023
bba29f7
#12 fix simulate test
martinjrobins Dec 20, 2023
6396f2f
#12 fix typing for python < 3.10
martinjrobins Dec 20, 2023
419b328
#12 type subscripting for python 3.8
martinjrobins Dec 20, 2023
904a85e
#12 fix ecm example
martinjrobins Dec 20, 2023
7263fcd
#12 try and fix 3.8 again
martinjrobins Dec 20, 2023
6512829
#12 increase coverage
martinjrobins Dec 20, 2023
801cc82
style: pre-commit fixes
pre-commit-ci[bot] Dec 20, 2023
1469989
#12 return log likelihood from observer
martinjrobins Dec 22, 2023
6babfca
#12 observer cost passes test, but vry slow!
martinjrobins Dec 23, 2023
c24198b
style: pre-commit fixes
pre-commit-ci[bot] Dec 23, 2023
d0039e5
#12 fix observer test
martinjrobins Jan 8, 2024
7354fd0
Merge branch 'i12-unscented-kalman' of github.com:pybop-team/PyBOP in…
martinjrobins Jan 8, 2024
036abfd
#12 fix ukf test
martinjrobins Jan 8, 2024
e5d7df9
Update pybop/models/base_model.py
martinjrobins Jan 8, 2024
84a9f62
Update pybop/models/base_model.py
martinjrobins Jan 8, 2024
eb337e7
Update pybop/observers/observer.py
martinjrobins Jan 8, 2024
6ccf5e0
Update pybop/observers/observer.py
martinjrobins Jan 8, 2024
f5deb70
Update pybop/observers/observer.py
martinjrobins Jan 8, 2024
7fe4c9f
Update tests/unit/test_observers.py
martinjrobins Jan 8, 2024
909a8e4
Update tests/unit/exponential_decay.py
martinjrobins Jan 8, 2024
98d3767
#12 more info in step docstring about time units
martinjrobins Jan 11, 2024
e690a00
Merge branch 'i12-unscented-kalman' of github.com:pybop-team/PyBOP in…
martinjrobins Jan 11, 2024
ad82ff9
#12 add comment for Covariance subtype
martinjrobins Jan 11, 2024
ceced10
#12 precalculate sigma_points_diff
martinjrobins Jan 11, 2024
026cb84
Merge branch 'develop' into i12-unscented-kalman
martinjrobins Jan 11, 2024
425a137
#12 A | B -> Union[A, B] for python 3.9
martinjrobins Jan 11, 2024
dda30f2
#12 get covariance from observer
martinjrobins Jan 11, 2024
0ea800b
style: pre-commit fixes
pre-commit-ci[bot] Jan 11, 2024
bf7561f
#12 try from __future__ import annotations
martinjrobins Jan 11, 2024
eadefde
Merge branch 'i12-unscented-kalman' of github.com:pybop-team/PyBOP in…
martinjrobins Jan 11, 2024
e82b058
#12 move __future__ to top
martinjrobins Jan 11, 2024
0e5093d
Merge branch '164-adam-optimiser-failing-tests' into i12-unscented-ka…
martinjrobins Jan 12, 2024
2e9a459
Refactor GravimetricEnergyDensity, nominalcapacity, cell_mass, into C…
BradyPlanden Jan 12, 2024
b2197ba
Updt quick_plot trace names for DesignOptimisation
BradyPlanden Jan 12, 2024
84cd51b
Updt. tests for coverage, updt. UserWarnings catch
BradyPlanden Jan 12, 2024
ea53a8c
Add notebook example
BradyPlanden Jan 16, 2024
6fb6b6d
Add model.rebuild(), model.copy(), and tests
BradyPlanden Jan 17, 2024
c1fd372
refactor test + add prediction comparison
BradyPlanden Jan 17, 2024
6e8d664
Add geometric parameter dict, add logic for geometric/non-geometric r…
BradyPlanden Jan 18, 2024
8356b3a
Updt tests, add functionality for simulate() with geometric parameter…
BradyPlanden Jan 18, 2024
f320427
Add rebuild_parameters to Thevenin
BradyPlanden Jan 18, 2024
d8bd78f
refactor parameter_classification, add model getter to problem class,…
BradyPlanden Jan 19, 2024
4633383
Merge branch 'develop' into i12-unscented-kalman
NicolaCourtier Jan 22, 2024
a441722
Add check_params to exponential_decay
NicolaCourtier Jan 22, 2024
dc03ca5
Merge branch 'develop' into 162-update-design-optimisation-functionality
BradyPlanden Jan 23, 2024
074afdd
#12 allow to switch off states in UKF
martinjrobins Jan 23, 2024
9682765
Merge branch 'i12-unscented-kalman' of github.com:pybop-team/PyBOP in…
martinjrobins Jan 23, 2024
02bec32
Merge branch 'develop' into i12-unscented-kalman
NicolaCourtier Jan 23, 2024
a9976eb
Restore default check_params
NicolaCourtier Jan 23, 2024
2b0698c
Update keyword
NicolaCourtier Jan 23, 2024
63ffe61
Merge branch 'develop' into 18-how-to-handle-structural-parameters
BradyPlanden Jan 23, 2024
3078505
Merge branch 'develop' into 162-update-design-optimisation-functionality
NicolaCourtier Jan 25, 2024
17bd452
Spell check
NicolaCourtier Jan 25, 2024
ffd7f3f
Merge branch 'develop' into i12-unscented-kalman
NicolaCourtier Jan 25, 2024
85a97fc
Move exponential model into examples/standalone
NicolaCourtier Jan 25, 2024
98110f6
Update CHANGELOG.md
NicolaCourtier Jan 25, 2024
94ec16e
Merge branch 'develop' into 63-bug-nlopt-install-error-for-apple-silicon
NicolaCourtier Jan 26, 2024
e331ba5
Update choice of examples in Readme
NicolaCourtier Jan 26, 2024
4c1269d
Update test_standalone.py
NicolaCourtier Jan 26, 2024
cb103cb
Update test_standalone.py
NicolaCourtier Jan 26, 2024
e0e4e15
#12 test coverage
martinjrobins Jan 29, 2024
77892b6
Merge pull request #172 from pybop-team/63-bug-nlopt-install-error-fo…
BradyPlanden Jan 30, 2024
68bf5fa
Merge branch 'develop' into i12-unscented-kalman
NicolaCourtier Jan 31, 2024
dd7f1bd
Merge branch 'develop' into 162-update-design-optimisation-functionality
BradyPlanden Jan 31, 2024
8d59942
style: pre-commit fixes
pre-commit-ci[bot] Jan 31, 2024
3e78e24
chore: update pre-commit hooks
pre-commit-ci[bot] Feb 5, 2024
cf25c8b
Merge pull request #181 from pybop-team/pre-commit-ci-update-config
BradyPlanden Feb 6, 2024
8d5f46a
Updt nominal_capacity() to be optional, with default false
BradyPlanden Feb 7, 2024
7ae745b
Allow square-bracket access to datasets
MarkBlyth Feb 7, 2024
58fb8ee
Merge branch 'pybop-team:develop' into develop
MarkBlyth Feb 7, 2024
6d0d460
I12b unscented kalman edits (#180)
NicolaCourtier Feb 7, 2024
0d65dc5
Merge branch 'develop' into 162-update-design-optimisation-functionality
NicolaCourtier Feb 7, 2024
a53af1a
Merge pull request #152 from pybop-team/i12-unscented-kalman
martinjrobins Feb 7, 2024
9fb70c3
docs: update README.md [skip ci]
allcontributors[bot] Feb 8, 2024
1e02300
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Feb 8, 2024
7fbc5f3
Restore manual entries
BradyPlanden Feb 8, 2024
81ef4a4
Merge pull request #184 from pybop-team/all-contributors/add-martinjr…
BradyPlanden Feb 8, 2024
db672b4
Add test for square-brackets dataset access
MarkBlyth Feb 8, 2024
63c8ca3
Add PR description
MarkBlyth Feb 8, 2024
b459cec
Merge branch 'develop' of https://github.com/MarkBlyth/PyBOP_function…
MarkBlyth Feb 8, 2024
32dabb7
Add intermediate model classes (#183)
NicolaCourtier Feb 8, 2024
6f3ba1a
Merge branch 'develop' into 162-update-design-optimisation-functionality
NicolaCourtier Feb 8, 2024
0076334
Fix merge of test_cost
NicolaCourtier Feb 8, 2024
d1c4e06
Update spme_max_energy.py
NicolaCourtier Feb 8, 2024
06a9c5a
Merge branch 'develop' into 18-how-to-handle-structural-parameters
NicolaCourtier Feb 8, 2024
44e935c
Update simulate
NicolaCourtier Feb 8, 2024
d3fa97f
Add BaseModel tests
BradyPlanden Feb 9, 2024
27c49f0
Merge pull request #167 from pybop-team/162-update-design-optimisatio…
BradyPlanden Feb 9, 2024
3fa1249
Add M1 GitHub runners, Updt. self-hosted
BradyPlanden Feb 9, 2024
1253360
Updt changelog
BradyPlanden Feb 9, 2024
3cf96ae
Remove M1 tests on unsupported python versions
BradyPlanden Feb 9, 2024
7d09c5d
Add VolumetricEnergyDensity example (#191)
NicolaCourtier Feb 9, 2024
695170f
#123 rename: `release-action` to `release_action`
agriyakhetarpal Feb 11, 2024
bff90d6
#123 add custom script to dynamically generate matrix
agriyakhetarpal Feb 11, 2024
4f64bd4
#123 run script, pass generated matrix to next job
agriyakhetarpal Feb 11, 2024
48a3e12
#123 make script executable prior to running it
agriyakhetarpal Feb 11, 2024
c324365
#123 don't allow running M-series builds on forks
agriyakhetarpal Feb 11, 2024
e56eb36
#123 don't use `git update-index` for file permissions
agriyakhetarpal Feb 11, 2024
8c06d23
#123 move script to a dedicated `scripts/ci/` folder
agriyakhetarpal Feb 11, 2024
bfe8474
#123 correctly sparse checkout the matrix script
agriyakhetarpal Feb 11, 2024
77e233d
#123 fix up script to return valid JSON
agriyakhetarpal Feb 11, 2024
d26a48f
#123 simplify GitHub Actions output processing
agriyakhetarpal Feb 11, 2024
a4e0979
#123 convert JSON to string before parsing
agriyakhetarpal Feb 11, 2024
4679821
#123 move output before all jobs and test
agriyakhetarpal Feb 11, 2024
d09b537
#123 don't convert JSON output to raw strings
agriyakhetarpal Feb 11, 2024
4d9d732
#123 matrix script is working now, clean it up
agriyakhetarpal Feb 11, 2024
03bf40c
#123 specify a prettified job name via matrix variables
agriyakhetarpal Feb 11, 2024
b77d932
#123 temporarily fetch last three versions, not four
agriyakhetarpal Feb 12, 2024
bcc7983
#123 add `PYBOP_SCHEDULED` and `PYBAMM_VERSION`
agriyakhetarpal Feb 12, 2024
23b7be2
#123 configure `PYBAMM_VERSION` env var
agriyakhetarpal Feb 12, 2024
6cb7264
chore: update pre-commit hooks
pre-commit-ci[bot] Feb 12, 2024
c295138
Merge pull request #194 from pybop-team/pre-commit-ci-update-config
BradyPlanden Feb 13, 2024
7024166
Lengthen test data, updat init_soc for test, flip higher cost solutio…
BradyPlanden Feb 13, 2024
264a4d2
Merge branch 'develop' into 187-add-m-series-github-runners-to-tests
BradyPlanden Feb 13, 2024
0d05f8b
Merge branch '187-add-m-series-github-runners-to-tests' into 196-bug-…
BradyPlanden Feb 13, 2024
5e6c73c
Merge pull request #197 from pybop-team/196-bug-observer-tests-fail-o…
martinjrobins Feb 13, 2024
59653d4
Updt. Changelog for #196 addition
BradyPlanden Feb 13, 2024
a8b54d1
Merge pull request #188 from pybop-team/187-add-m-series-github-runne…
BradyPlanden Feb 13, 2024
1f07663
#123 merge develop
agriyakhetarpal Feb 13, 2024
08c72b1
#123 add feature note to CHANGELOG
agriyakhetarpal Feb 13, 2024
937aea4
#123 moving forward with PyBaMM parameter set check
agriyakhetarpal Feb 14, 2024
9572d8f
#123 update CHANGELOG under bug fixes
agriyakhetarpal Feb 14, 2024
c2423a8
Merge pull request #193 from agriyakhetarpal/test-against-pybamm
BradyPlanden Feb 16, 2024
e573c35
docs: update README.md [skip ci]
allcontributors[bot] Feb 16, 2024
d3515e1
docs: update .all-contributorsrc [skip ci]
allcontributors[bot] Feb 16, 2024
c72cf71
Update README.md
BradyPlanden Feb 16, 2024
d58b43a
Merge pull request #199 from pybop-team/all-contributors/add-agriyakh…
BradyPlanden Feb 16, 2024
505a588
Make PyBOP version private attr, use `importlib.metadata`
agriyakhetarpal Feb 16, 2024
b07ca7f
Remove distutils & metadata boilerplate, shift to PEP517
agriyakhetarpal Feb 16, 2024
388496b
Move `pytest`, `ruff` config to `pyproject.toml`
agriyakhetarpal Feb 16, 2024
aa6a9d2
Migrate to `pyproject.toml` (declarative metadata)
agriyakhetarpal Feb 16, 2024
913fcde
Add CHANGELOG entry for `pyproject.toml`
agriyakhetarpal Feb 16, 2024
ef8968c
Add matrix to m-series runner
BradyPlanden Feb 17, 2024
917cd06
Add filtered matrix job, update m-series env
BradyPlanden Feb 17, 2024
a044e1b
Update .github/workflows/scheduled_tests.yaml
BradyPlanden Feb 17, 2024
e4909e0
Restores pyenv environment initialisation
BradyPlanden Feb 17, 2024
d0fbd7d
os bug patch
BradyPlanden Feb 17, 2024
9cd5f83
revert to single item nox calls
BradyPlanden Feb 17, 2024
c0cfb56
updt. filtered item name
BradyPlanden Feb 17, 2024
59aec2b
Merge develop
BradyPlanden Feb 17, 2024
ff9ab82
Merge branch 'develop' into 18-how-to-handle-structural-parameters
BradyPlanden Feb 17, 2024
e9fb74c
Merge pull request #205 from pybop-team/193-patch-m-series
BradyPlanden Feb 17, 2024
b625ae3
Merge pull request #182 from MarkBlyth/develop
BradyPlanden Feb 19, 2024
2af4397
update Python version requirements to remove 3.12
agriyakhetarpal Feb 19, 2024
9bc2c30
Make notes about `[dev]` and `[docs]` extras, revise config
agriyakhetarpal Feb 19, 2024
a6e32a1
Add the `[dev]` extras (pytest, nbmake, pre-commit)
agriyakhetarpal Feb 19, 2024
45df796
Use `[dev]` extras for nox session invocations
agriyakhetarpal Feb 19, 2024
d3c845e
Merge pull request #203 from agriyakhetarpal/add-pep517/518-pyproject
BradyPlanden Feb 19, 2024
547f512
chore: update pre-commit hooks
pre-commit-ci[bot] Feb 19, 2024
02509bd
Merge branch 'develop' into 18-how-to-handle-structural-parameters
BradyPlanden Feb 19, 2024
fde941b
Change spm_CMAES example to geometric parameters, add true_value to p…
BradyPlanden Feb 19, 2024
8624a44
Add tests for pybop parameters
BradyPlanden Feb 20, 2024
209c5dc
Merge pull request #208 from pybop-team/pre-commit-ci-update-config
BradyPlanden Feb 20, 2024
8b2a655
bump upper python version
BradyPlanden Feb 20, 2024
55f3768
updt test_on_push workflow for 3.12
BradyPlanden Feb 20, 2024
dc9effe
Updts python matrix for scheduled tests
BradyPlanden Feb 20, 2024
7e8fd4c
Updt. matrix generation for incompatible pybamm/python versions
BradyPlanden Feb 20, 2024
e03cbb5
updt workflow order to ensure self-hosted runner starts in parallel
BradyPlanden Feb 20, 2024
bab2872
Update .github/workflows/scheduled_tests.yaml
BradyPlanden Feb 20, 2024
98cbe4a
Updt to filter with jq
BradyPlanden Feb 20, 2024
a104554
revert build trigger, requires create_matrix for matrix, filter_matri…
BradyPlanden Feb 21, 2024
626eb60
Updt Changelog, rm redundant example
BradyPlanden Feb 21, 2024
d8071f2
Add 23.9 / 3.12 to filter
BradyPlanden Feb 21, 2024
7e11e0b
Add tests for rebuild, and increase pybop.parameter tests
BradyPlanden Feb 21, 2024
fb9053d
Updt problem tests, revert model_tests
BradyPlanden Feb 21, 2024
0757091
remove redundant rebuild condition
BradyPlanden Feb 21, 2024
8a17a99
remove missed merge delete
BradyPlanden Feb 21, 2024
ad9a883
Merge pull request #169 from pybop-team/18-how-to-handle-structural-p…
BradyPlanden Feb 21, 2024
8561c52
Merge pull request #209 from pybop-team/206-support-python-312
BradyPlanden Feb 21, 2024
7a30ca0
Patch: add changelog entry for #206
BradyPlanden Feb 21, 2024
dd642ea
Merge branch 'develop' into compile-pybamm-idaklu-solver-from-source
agriyakhetarpal Feb 26, 2024
326ceda
Compile PyBaMM from source for PyBOP coverage tests
agriyakhetarpal Feb 26, 2024
6d20d62
style: pre-commit fixes
pre-commit-ci[bot] Feb 26, 2024
d63fc76
Exclude unneeded directories from test collection
agriyakhetarpal Feb 26, 2024
91644c5
Compile IDAKLU from source for unit tests
agriyakhetarpal Feb 26, 2024
42235b1
Temporarily compile IDAKLU for all platforms
agriyakhetarpal Feb 26, 2024
19ca465
Fix macOS and Windows IDAKLU builds
agriyakhetarpal Feb 26, 2024
d8ea216
Add LLVM-OpenMP spec for Homebrew installation
agriyakhetarpal Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
"contributions": [
"ideas",
"mentoring",
"review"
"review",
"code",
"test"
]
},
{
Expand Down Expand Up @@ -79,6 +81,16 @@
"contributions": [
"financial"
]
},
{
"login": "agriyakhetarpal",
"name": "Agriya Khetarpal",
"avatar_url": "https://avatars.githubusercontent.com/u/74401230?v=4",
"profile": "https://github.com/agriyakhetarpal",
"contributions": [
"code",
"infra"
]
}
],
"contributorsPerLine": 7,
Expand Down
93 changes: 76 additions & 17 deletions .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,113 @@ on:
schedule:
- cron: '0 9 * * *'

# Check noxfile.py for associated environment variables
env:
PYBOP_SCHEDULED: 1

jobs:
# Dynamically create a matrix of OS, Python, and PyBaMM versions
create_pybamm_matrix:
name: Dynamically create GitHub Actions matrix
runs-on: ubuntu-latest
steps:
- name: Check out PyBOP repository
uses: actions/checkout@v4
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
scripts/ci/build_matrix.sh

- name: Run script to create matrix
id: set-matrix
run: |
echo "matrix=$(bash scripts/ci/build_matrix.sh)" >> "$GITHUB_OUTPUT"
outputs:
pybop_matrix: ${{ steps.set-matrix.outputs.matrix }}

# filter the matrix to only include the macOS-latest entries
filter_pybamm_matrix:
name: Filter the matrix for macOS-latest entries
needs: [create_pybamm_matrix]
runs-on: ubuntu-latest
outputs:
filtered_pybop_matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Filter pybop matrix
id: set-matrix
run: |
import json
import os

# Get the matrix
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']
filtered_matrix = {'include': filtered_entries}

# Set the output variable for other jobs to use
output_file = os.environ['GITHUB_OUTPUT']
with open(output_file, "a", encoding="utf-8") as output_stream:
output_stream.write(f"matrix={json.dumps(filtered_matrix)}\n")
shell: python

build:
needs: [create_pybamm_matrix, filter_pybamm_matrix]
name: Build (${{ matrix.os }}, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
matrix: ${{fromJson(needs.create_pybamm_matrix.outputs.pybop_matrix)}}
env:
PYBAMM_VERSION: ${{ matrix.pybamm_version }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python_version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip nox

- name: Unit tests with nox
run: |
python -m nox -s unit
python -m nox -s notebooks
run: python -m nox -s unit

#M-series Mac Mini
- name: Run notebooks with nox
run: python -m nox -s notebooks

# M-series Mac Mini
build-apple-mseries:
needs: [filter_pybamm_matrix]
name: Build (MacOS M-series, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
runs-on: [self-hosted, macOS, ARM64]
if: github.repository == 'pybop-team/PyBOP'
env:
GITHUB_PATH: ${PYENV_ROOT/bin:$PATH}
PYBAMM_VERSION: ${{ matrix.pybamm_version }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
matrix: ${{fromJson(needs.filter_pybamm_matrix.outputs.filtered_pybop_matrix)}}

steps:
- uses: actions/checkout@v4
- name: Install python & create virtualenv
shell: bash
run: |
eval "$(pyenv init -)"
pyenv install ${{ matrix.python-version }} -s
pyenv virtualenv ${{ matrix.python-version }} pybop-${{ matrix.python-version }}
pyenv install ${{ matrix.python_version }} -s
pyenv virtualenv ${{ matrix.python_version }} pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}

- name: Install dependencies & run unit tests
- name: Install dependencies & run unit + notebook tests
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python-version }}
python -m pip install --upgrade pip wheel setuptools nox
pyenv activate pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
python -m pip install --upgrade pip nox
python -m nox -s unit
python -m nox -s notebooks

Expand All @@ -66,5 +125,5 @@ jobs:
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python-version }}
pyenv activate pybop-${{ matrix.python_version }}-${{ matrix.pybamm_version }}
pyenv uninstall -f $( python --version )
101 changes: 96 additions & 5 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,96 @@ jobs:


build:
needs: style
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude: # We run the coverage tests on Ubuntu with Python 3.11
- os: ubuntu-latest
python-version: "3.11"
# 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"

steps:
- uses: actions/checkout@v4
- name: Check out PyBOP repository
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 --upgrade pip nox

- name: Check out PyBaMM v24.1
uses: actions/checkout@v4
with:
repository: pybamm-team/PyBaMM
ref: v24.1
path: pybamm

- name: Compile PyBaMM from source with IDAKLU solver (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
run: |
cd pybamm
sudo apt-get update && sudo apt-get install -y libopenblas-dev
python -m nox -s pybamm-requires
python -m pip install .[all]
cd ..

- name: Compile PyBaMM from source with IDAKLU solver (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew reinstall gcc
brew install libomp
cd pybamm
python -m nox -s pybamm-requires
python -m pip install .[all]
cd ..

- name: Compile PyBaMM from source with IDAKLU solver (macos-14)
if: matrix.os == 'macos-14'
run: |
brew reinstall gcc
brew install libomp
cd pybamm
python -m nox -s pybamm-requires
python -m pip install .[all]
cd ..

# TODO: remove later, temporary addition to test Windows build
- name: Compile PyBaMM from source with IDAKLU solver (windows-latest)
if: matrix.os == 'windows-latest'
env:
PYBAMM_USE_VCPKG: "ON"
VCPKG_ROOT_DIR: C:\vcpkg
VCPKG_DEFAULT_TRIPLET: x64-windows-static-md
VCPKG_FEATURE_FLAGS: manifests,registries
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_PLATFORM: x64
CMAKE_BUILD_PARALLEL_LEVEL: 4
run: |
cd pybamm
git clone --depth 1 --branch v2.11.1 https://github.com/pybind/pybind11.git
python -m pip install .[all]
cd ..

- name: Unit and notebook tests with nox
run: |
nox -s unit
nox -s notebooks
pip install -e .[all,dev]
python -m pytest --unit
python -m pytest --nbmake --examples examples/

# Runs only on Ubuntu with Python 3.11
check_coverage:
Expand All @@ -60,6 +130,7 @@ jobs:
steps:
- name: Check out PyBOP repository
uses: actions/checkout@v4

- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v4
Expand All @@ -71,8 +142,28 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox

- name: Check out PyBaMM v24.1
uses: actions/checkout@v4
with:
repository: pybamm-team/PyBaMM
ref: v24.1
path: pybamm

- name: Compile PyBaMM from source with IDAKLU solver (ubuntu-latest)
run: |
cd pybamm
sudo apt-get update
sudo apt-get install -y libopenblas-dev
python -m nox -s pybamm-requires
python -m pip install .[all]
rm -rf pybind11/
cd ..

- name: Run coverage tests for Ubuntu with Python 3.11 and generate report
run: nox -s coverage
run: |
pip install -e .[all,dev]
python -m pytest --unit --examples --cov --cov-report=xml

- name: Upload coverage report
uses: codecov/codecov-action@v3
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.1.14"
rev: "v0.2.2"
hooks:
- id: ruff
args: [--fix, --show-fixes]
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@

## Features

- [#206](https://github.com/pybop-team/PyBOP/pull/206) - Adds Python 3.12 support with corresponding github actions changes.
- [#18](https://github.com/pybop-team/PyBOP/pull/18) - Adds geometric parameter fitting capability, via `model.rebuild()` with `model.rebuild_parameters`.
- [#203](https://github.com/pybop-team/PyBOP/pull/203) - Adds support for modern Python packaging via a `pyproject.toml` file and configures the `pytest` test runner and `ruff` linter to use their configurations stored as declarative metadata.
- [#123](https://github.com/pybop-team/PyBOP/issues/123) - Configures scheduled tests to run against the last three PyPI releases of PyBaMM via dynamic GitHub Actions matrix generation.
- [#187](https://github.com/pybop-team/PyBOP/issues/187) - Adds M1 Github runner to `test_on_push` workflow, updt. self-hosted supported python versions in scheduled tests.
- [#118](https://github.com/pybop-team/PyBOP/issues/118) - Adds example jupyter notebooks.
- [#151](https://github.com/pybop-team/PyBOP/issues/151) - Adds a standalone version of the Problem class.
- [#12](https://github.com/pybop-team/PyBOP/issues/12) - Adds initial implementation of an Observer class and an unscented Kalman filter.
- [#190](https://github.com/pybop-team/PyBOP/issues/190) - Adds a second example design cost, namely the VolumetricEnergyDensity.

## Bug Fixes

- [#123](https://github.com/pybop-team/PyBOP/issues/123) - Reinstates check for availability of parameter sets via PyBaMM upon retrieval by `pybop.ParameterSet.pybamm()`.
- [#196](https://github.com/pybop-team/PyBOP/issues/196) - Fixes failing observer cost tests.
- [#63](https://github.com/pybop-team/PyBOP/issues/63) - Removes NLOpt Optimiser from future releases. This is to support deployment to the Apple M-Series platform.
- [#164](https://github.com/pybop-team/PyBOP/issues/164) - Fixes convergence issues with gradient-based optimisers, changes default `model.check_params()` to allow infeasible solutions during optimisation iterations. Adds a feasibility check on the optimal parameters.

# [v23.12](https://github.com/pybop-team/PyBOP/tree/v23.12) - 2023-12-19

## Features

- [#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.
Expand All @@ -28,6 +38,8 @@

## Bug Fixes

- [#182](https://github.com/pybop-team/PyBOP/pull/182) - Allow square-brackets indexing of Dataset

# [v23.11](https://github.com/pybop-team/PyBOP/releases/tag/v23.11)
- Initial release
- Adds Pints, NLOpt, and SciPy optimisers
Expand Down
Loading
Loading