diff --git a/tests/unit/test_optimisation.py b/tests/unit/test_optimisation.py index 00bcd9d16..4bc7e72eb 100644 --- a/tests/unit/test_optimisation.py +++ b/tests/unit/test_optimisation.py @@ -18,7 +18,7 @@ def dataset(self): return pybop.Dataset( { "Time [s]": np.linspace(0, 360, 10), - "Current function [A]": 0.01 * np.ones(10), + "Current function [A]": 1e-3 * np.ones(10), "Voltage [V]": np.ones(10), } ) @@ -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=3, tol=1e-6) + optim = optimiser(cost=cost, maxiter=1, tol=1e-6) cost_bounds = cost.parameters.get_bounds() # Check maximum iterations results = optim.run() - assert results.n_iterations == 3 + assert results.n_iterations == 1 if optimiser in [pybop.GradientDescent, pybop.Adam, pybop.NelderMead]: # Ignored bounds @@ -552,11 +552,11 @@ def test_unphysical_result(self, cost): @pytest.mark.unit def test_optimsation_results(self, cost): # Construct OptimisationResult - results = pybop.OptimisationResult(x=[0.55], cost=cost, n_iterations=1) + results = pybop.OptimisationResult(x=[1e-3], cost=cost, n_iterations=1) # Asserts - assert results.x[0] == 0.55 - assert results.final_cost == cost([0.55]) + assert results.x[0] == 1e-3 + assert results.final_cost == cost([1e-3]) assert results.n_iterations == 1 # Test non-finite results