Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 88d3344

Browse files
author
Tanguy Damart
committed
Add cma example
1 parent 59caebc commit 88d3344

File tree

3 files changed

+368
-2
lines changed

3 files changed

+368
-2
lines changed

bluepyopt/deapext/optimisations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def setup_deap(self):
162162
# Number of parameters
163163
IND_SIZE = len(self.evaluator.params)
164164
if IND_SIZE == 0:
165-
raise Exception(
165+
raise ValueError(
166166
"Length of evaluator.params is zero. At least one "
167167
"non-fix parameter is needed to run an optimization."
168168
)

bluepyopt/tests/test_deapext/test_optimisationsCMA.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_optimisationsCMA_SO_run():
3333
optimiser = bluepyopt.deapext.optimisationsCMA.DEAPOptimisationCMA
3434
optimisation = optimiser(evaluator=evaluator, centroids=[x])
3535
pop, hof, log, hist = optimisation.run(max_ngen=2)
36-
36+
3737
assert abs(log.select("avg")[-1] - 53.3333) < 1e-4
3838
assert abs(log.select("std")[-1] - 83.7987) < 1e-4
3939
assert pop[0] == [0.10525059698894745, 0.01000000003249999]

0 commit comments

Comments
 (0)