Skip to content

Commit

Permalink
pybop-team#123 merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Feb 13, 2024
2 parents 23b7be2 + a8b54d1 commit 1f07663
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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: 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.2.0"
rev: "v0.2.1"
hooks:
- id: ruff
args: [--fix, --show-fixes]
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

0 comments on commit 1f07663

Please sign in to comment.