From ee73c2bd4a3a21b611dc2a8ddfe6d3e2d5f10a1e Mon Sep 17 00:00:00 2001 From: Brady Planden Date: Fri, 5 Jul 2024 12:55:00 +0100 Subject: [PATCH] fixes from code review, user output for boundaries --- CHANGELOG.md | 2 +- pybop/costs/_likelihoods.py | 1 - pybop/parameters/parameter.py | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0876137..e5e93849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ ## Bug Fixes -- [#338](https://github.com/pybop-team/PyBOP/pull/338) - Fixes GaussianLogLikelihood class, adds integration tests, updates non-bounded parameter implementation and bugfix to CMAES construction. +- [#338](https://github.com/pybop-team/PyBOP/pull/338) - Fixes GaussianLogLikelihood class, adds integration tests, updates non-bounded parameter implementation by applying bounds from priors and `boundary_multiplier` argument. Bugfixes to CMAES construction. - [#339](https://github.com/pybop-team/PyBOP/issues/339) - Updates the calculation of the cyclable lithium capacity in the spme_max_energy example. - [#387](https://github.com/pybop-team/PyBOP/issues/387) - Adds keys to ParameterSet and updates ECM OCV check. - [#380](https://github.com/pybop-team/PyBOP/pull/380) - Restore self._boundaries construction for `pybop.PSO` diff --git a/pybop/costs/_likelihoods.py b/pybop/costs/_likelihoods.py index 896d0c0d..6d5edb38 100644 --- a/pybop/costs/_likelihoods.py +++ b/pybop/costs/_likelihoods.py @@ -16,7 +16,6 @@ class BaseLikelihood(BaseCost): def __init__(self, problem: BaseProblem): super(BaseLikelihood, self).__init__(problem) self.n_time_data = problem.n_time_data - self.n_outputs = self.n_outputs or None class GaussianLogLikelihoodKnownSigma(BaseLikelihood): diff --git a/pybop/parameters/parameter.py b/pybop/parameters/parameter.py index 91122814..67f1896d 100644 --- a/pybop/parameters/parameter.py +++ b/pybop/parameters/parameter.py @@ -156,6 +156,7 @@ def set_bounds(self, bounds=None, boundary_multiplier=6): self.lower_bound = self.prior.mean - boundary_multiplier * self.prior.sigma self.upper_bound = self.prior.mean + boundary_multiplier * self.prior.sigma bounds = [self.lower_bound, self.upper_bound] + print("Default bounds applied based on prior distribution.") self.bounds = bounds