Skip to content

Commit

Permalink
Merge pull request #197 from pybop-team/196-bug-observer-tests-fail-o…
Browse files Browse the repository at this point in the history
…n-m-series-hardware-macos-140

Fixes failing observer tests
  • Loading branch information
martinjrobins authored Feb 13, 2024
2 parents 264a4d2 + 0d05f8b commit 5e6c73c
Showing 1 changed file with 5 additions and 3 deletions.
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 5e6c73c

Please sign in to comment.