From 0d58d08ac9480d17bfee92e6ce514202cf4855e4 Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Fri, 31 May 2024 13:25:46 +0100 Subject: [PATCH] fix: update changelog, fix errant misparameterisation assert --- CHANGELOG.md | 2 +- tests/integration/test_spm_parameterisations.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ff5d2c..5facc001 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ## Bug Fixes -- [#333](https://github.com/pybop-team/PyBOP/issues/333) - Restores benchmarks, relaxes CI schedule for benchmarks and scheduled tests. +- [#337](https://github.com/pybop-team/PyBOP/issues/337) - Restores benchmarks, relaxes CI schedule for benchmarks and scheduled tests. - [#231](https://github.com/pybop-team/PyBOP/issues/231) - Allows passing of keyword arguments to PyBaMM models and disables build on initialisation. - [#321](https://github.com/pybop-team/PyBOP/pull/321) - Improves `integration/test_spm_parameterisation.py` stability, adds flakly pytest plugin, and `test_thevenin_parameterisation.py` integration test. - [#330](https://github.com/pybop-team/PyBOP/issues/330) - Fixes implementation of default plotting options. diff --git a/tests/integration/test_spm_parameterisations.py b/tests/integration/test_spm_parameterisations.py index eada8d9b..470bfe0d 100644 --- a/tests/integration/test_spm_parameterisations.py +++ b/tests/integration/test_spm_parameterisations.py @@ -231,14 +231,14 @@ def test_model_misparameterisation(self, parameters, model, init_soc): optimiser = pybop.CMAES # Build the optimisation problem - parameterisation = optimiser(cost=cost) + optim = optimiser(cost=cost) + initial_cost = optim.cost(cost.x0) # Run the optimisation problem - x, final_cost = parameterisation.run() + x, final_cost = optim.run() # Assertion for final_cost - with np.testing.assert_raises(AssertionError): - np.testing.assert_allclose(final_cost, 0, atol=1e-2) + assert initial_cost > final_cost # Assertion for x with np.testing.assert_raises(AssertionError):