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 M1 GitHub runner and update scheduled tests #188

Merged
merged 8 commits into from
Feb 13, 2024
2 changes: 1 addition & 1 deletion .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,22 @@ 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"]
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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

## 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.
- [#190](https://github.com/pybop-team/PyBOP/issues/190) - Adds a second example design cost, namely the VolumetricEnergyDensity.

## 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.

Expand Down
8 changes: 5 additions & 3 deletions tests/unit/test_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"),
]
)

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
Loading