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

Commit 4547971

Browse files
committed
Merge with master
2 parents 819a553 + a0c8010 commit 4547971

File tree

18 files changed

+425
-35
lines changed

18 files changed

+425
-35
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ x86_64
1111
/cov_reports
1212
.coverage
1313
coverage.xml
14+
.idea/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016-2020, EPFL/Blue Brain Project
1+
# Copyright (c) 2016-2022, EPFL/Blue Brain Project
22
#
33
# This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
44
#

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Examples and test are BSD-licensed.
66
External dependencies are either LGPL or BSD-licensed.
77
See file ACKNOWLEDGEMENTS.txt and AUTHORS.txt for further details.
88

9-
Copyright (c) Blue Brain Project/EPFL 2016-2021.
9+
Copyright (c) Blue Brain Project/EPFL 2016-2022.
1010

1111
This program is free software: you can redistribute it and/or modify it under
1212
the terms of the GNU Lesser General Public License as published by the

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Funding
198198
This work has been partially funded by the European Union Seventh Framework Program (FP7/2007­2013) under grant agreement no. 604102 (HBP), the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 720270, 785907 (Human Brain Project SGA1/SGA2) and by the EBRAINS research infrastructure, funded from the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 945539 (Human Brain Project SGA3).
199199
This project/research was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology.
200200

201-
Copyright (c) 2016-2021 Blue Brain Project/EPFL
201+
Copyright (c) 2016-2022 Blue Brain Project/EPFL
202202

203203
..
204204
The following image is also defined in the index.rst file, as the relative path is

bluepyopt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Init script"""
22

33
"""
4-
Copyright (c) 2016-2020, EPFL/Blue Brain Project
4+
Copyright (c) 2016-2022, EPFL/Blue Brain Project
55
66
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
77

bluepyopt/deapext/CMA_MO.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Multi Objective CMA-es class"""
22

33
"""
4-
Copyright (c) 2016-2020, EPFL/Blue Brain Project
4+
Copyright (c) 2016-2022, EPFL/Blue Brain Project
55
66
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
77
@@ -51,7 +51,7 @@ def get_hyped(pop, ubound_score=250., threshold_improvement=240.):
5151

5252
# Remove the dimensions that do not show any improvement
5353
to_remove = []
54-
for i, (lb, ub) in enumerate(zip(lbounds, ubounds)):
54+
for i, lb in enumerate(lbounds):
5555
if lb >= threshold_improvement:
5656
to_remove.append(i)
5757
points = numpy.delete(points, to_remove, axis=1)
@@ -63,6 +63,10 @@ def get_hyped(pop, ubound_score=250., threshold_improvement=240.):
6363
return [0.] * len(pop)
6464

6565
# Rescale the objective space
66+
# Note: 2 here is a magic number used to make the hypercube larger than it
67+
# really is. It makes sure that the individual always have a non-zero
68+
# hyper-volume contribution and improves the results while avoiding an
69+
# edge case.
6670
points = (points - lbounds) / numpy.max(ubounds.flatten())
6771
ubounds = numpy.max(points, axis=0) + 2.0
6872

@@ -104,7 +108,7 @@ def __init__(
104108
is computed as 1 - weight_hv.
105109
map_function (map): function used to map (parallelize) the
106110
evaluation function calls
107-
use_scoop (bool): use scoop map for parallel computation
111+
use_scoop (bool): use scoop map for parallel computation
108112
"""
109113

110114
if offspring_size is None:
@@ -145,7 +149,7 @@ def __init__(
145149
if self.use_scoop:
146150
if self.map_function:
147151
raise Exception(
148-
"Impossible to use scoop is providing self defined map "
152+
"Impossible to use scoop and provide self defined map "
149153
"function: %s" % self.map_function
150154
)
151155
from scoop import futures
@@ -172,13 +176,11 @@ def _select(self, candidates):
172176

173177
if self.weight_hv == 0.0:
174178
fit = [numpy.sum(ind.fitness.values) for ind in candidates]
175-
idx_fit = list(numpy.argsort(fit))
176-
idx_scores = idx_fit[:]
179+
idx_scores = list(numpy.argsort(fit))
177180

178181
elif self.weight_hv == 1.0:
179182
hv = get_hyped(candidates)
180-
idx_hv = list(numpy.argsort(hv))[::-1]
181-
idx_scores = idx_hv[:]
183+
idx_scores = list(numpy.argsort(hv))[::-1]
182184

183185
else:
184186
hv = get_hyped(candidates)
@@ -240,6 +242,6 @@ def check_termination(self, gen):
240242
if c.criteria_met:
241243
logger.info(
242244
"CMA stopped because of termination criteria: " +
243-
"" + " ".join(c.name)
245+
" ".join(c.name)
244246
)
245247
self.active = False

bluepyopt/deapext/CMA_SO.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Single Objective CMA-es class"""
22

33
"""
4-
Copyright (c) 2016-2020, EPFL/Blue Brain Project
4+
Copyright (c) 2016-2022, EPFL/Blue Brain Project
55
66
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
77
@@ -220,6 +220,6 @@ def check_termination(self, gen):
220220
if c.criteria_met:
221221
logger.info(
222222
"CMA stopped because of termination criteria: " +
223-
"" + " ".join(c.name)
223+
" ".join(c.name)
224224
)
225225
self.active = False

bluepyopt/deapext/algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Optimisation class"""
22

33
"""
4-
Copyright (c) 2016-2020, EPFL/Blue Brain Project
4+
Copyright (c) 2016-2022, EPFL/Blue Brain Project
55
66
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
77

bluepyopt/deapext/hype.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2016-2020, EPFL/Blue Brain Project
2+
Copyright (c) 2016-2022, EPFL/Blue Brain Project
33
44
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
55

bluepyopt/deapext/optimisations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Optimisation class"""
22

33
"""
4-
Copyright (c) 2016-2020, EPFL/Blue Brain Project
4+
Copyright (c) 2016-2022, EPFL/Blue Brain Project
55
66
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
77
@@ -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
)

0 commit comments

Comments
 (0)