Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 17, 2024
1 parent f2842bb commit 240e1ad
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pybop/optimisers/_random_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 240e1ad

Please sign in to comment.