From 240e1ad167e4401fa8f6c1944ba29f7e4f2efb27 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:43:53 +0000 Subject: [PATCH] style: pre-commit fixes --- pybop/optimisers/_random_search.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pybop/optimisers/_random_search.py b/pybop/optimisers/_random_search.py index c405fb690..683435c7e 100644 --- a/pybop/optimisers/_random_search.py +++ b/pybop/optimisers/_random_search.py @@ -38,12 +38,14 @@ def __init__(self, x0, sigma0=0.05, boundaries=None): self._boundaries = boundaries # Initialise population - self._candidates = np.random.uniform( - low=self._boundaries.lower(), - high=self._boundaries.upper(), - size=(self._n, self._dim), - ) if self._boundaries else np.random.normal( - self._x0, self._sigma0, size=(self._n, self._dim) + self._candidates = ( + np.random.uniform( + low=self._boundaries.lower(), + high=self._boundaries.upper(), + size=(self._n, self._dim), + ) + if self._boundaries + else np.random.normal(self._x0, self._sigma0, size=(self._n, self._dim)) ) # Initialise best solution @@ -69,7 +71,7 @@ def ask(self): ) else: self._candidates = np.random.normal( - self._x0, self._sigma0, size=(self._n, self._dim) + self._x0, self._sigma0, size=(self._n, self._dim) ) return self.clip_candidates(self._candidates)