From 3fa124932e13ad77fd71776190f6e7aba6037602 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Fri, 9 Feb 2024 09:48:55 +0000 Subject: [PATCH 1/5] Add M1 GitHub runners, Updt. self-hosted --- .github/workflows/scheduled_tests.yaml | 2 +- .github/workflows/test_on_push.yaml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_tests.yaml b/.github/workflows/scheduled_tests.yaml index 83a0d986b..490efea9e 100644 --- a/.github/workflows/scheduled_tests.yaml +++ b/.github/workflows/scheduled_tests.yaml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 688614e4a..8d810c32c 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -29,12 +29,16 @@ jobs: build: + needs: style runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest, macos-14] python-version: ["3.8", "3.9", "3.10", "3.11"] + exclude: # We run the coverage tests on Ubuntu with Python 3.11 + - os: ubuntu-latest + python-version: "3.11" steps: - uses: actions/checkout@v4 From 1253360d29066c1ce7b18151b39462b371b2c3ec Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Fri, 9 Feb 2024 09:53:15 +0000 Subject: [PATCH 2/5] Updt changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cee3076c..51f8ddf2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- [#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. From 3cf96ae150189b3baa7b6634add430f161236e4a Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Fri, 9 Feb 2024 09:55:50 +0000 Subject: [PATCH 3/5] Remove M1 tests on unsupported python versions --- .github/workflows/test_on_push.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 8d810c32c..a55219bbb 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -34,11 +34,17 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-14] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11"] 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" steps: - uses: actions/checkout@v4 From 702416624574a8eec9215e200709189598da1791 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Tue, 13 Feb 2024 14:14:25 +0000 Subject: [PATCH 4/5] Lengthen test data, updat init_soc for test, flip higher cost solution point --- tests/unit/test_cost.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_cost.py b/tests/unit/test_cost.py index 9a45d7139..aa127ffd4 100644 --- a/tests/unit/test_cost.py +++ b/tests/unit/test_cost.py @@ -27,7 +27,7 @@ def parameters(self): def experiment(self): return pybop.Experiment( [ - ("Discharge at 1C for 5 minutes (5 second period)"), + ("Discharge at 1C for 10 minutes (20 second period)"), ] ) @@ -60,7 +60,9 @@ def signal(self): def problem(self, model, parameters, dataset, signal, x0, request): cut_off = request.param model.parameter_set.update({"Lower voltage cut-off [V]": cut_off}) - problem = pybop.FittingProblem(model, parameters, dataset, signal=signal, x0=x0) + problem = pybop.FittingProblem( + model, parameters, dataset, signal=signal, x0=x0, init_soc=1.0 + ) return problem @pytest.fixture( @@ -112,7 +114,7 @@ def test_design_base(self, problem): @pytest.mark.unit def test_costs(self, cost): - higher_cost = cost([0.5]) + higher_cost = cost([0.55]) lower_cost = cost([0.52]) assert higher_cost > lower_cost or ( higher_cost == lower_cost and higher_cost == np.inf From 59653d42b537ad531c3ff4497bde98d35d9619f8 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Tue, 13 Feb 2024 14:50:22 +0000 Subject: [PATCH 5/5] Updt. Changelog for #196 addition --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 649bbac38..0077ef9f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ## Bug Fixes +- [#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.