Skip to content

Commit

Permalink
test: update test_optimisation for flaky CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyPlanden committed Oct 4, 2024
1 parent c4c3b9c commit 42bab27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def dataset(self):
return pybop.Dataset(
{
"Time [s]": np.linspace(0, 360, 10),
"Current function [A]": 1e-3 * np.ones(10),
"Current function [A]": 1e-2 * np.ones(10),
"Voltage [V]": np.ones(10),
}
)
Expand Down Expand Up @@ -134,12 +134,12 @@ def test_no_optimisation_parameters(self, model, dataset):
)
@pytest.mark.unit
def test_optimiser_kwargs(self, cost, optimiser):
optim = optimiser(cost=cost, maxiter=1, tol=1e-6)
optim = optimiser(cost=cost, maxiter=3, tol=1e-6)
cost_bounds = cost.parameters.get_bounds()

# Check maximum iterations
results = optim.run()
assert results.n_iterations == 1
assert results.n_iterations == 3

if optimiser in [pybop.GradientDescent, pybop.Adam, pybop.NelderMead]:
# Ignored bounds
Expand Down

0 comments on commit 42bab27

Please sign in to comment.