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

Commit a263ade

Browse files
Merge pull request #473 from BlueBrain/removefuture
remove __future__ imports
2 parents f7fd66d + 8c8fb4b commit a263ade

File tree

8 files changed

+77
-2281
lines changed

8 files changed

+77
-2281
lines changed

bluepyopt/deapext/tools/selIBEA.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
"""IBEA selector"""
22

3-
from __future__ import division
4-
5-
from past.builtins import xrange # pylint: disable=W0622
6-
73
"""
84
Copyright (c) 2016-2022, EPFL/Blue Brain Project
95
@@ -77,7 +73,7 @@ def _calc_fitness_components(population, kappa):
7773
box_ranges[box_ranges == 0] = 1.0
7874

7975
components_matrix = numpy.zeros((pop_len, pop_len))
80-
for i in xrange(0, pop_len):
76+
for i in range(0, pop_len):
8177
diff = population_matrix - population_matrix[i, :]
8278
components_matrix[i, :] = numpy.max(
8379
numpy.divide(diff, box_ranges),
@@ -115,9 +111,9 @@ def _mating_selection(population, mu, tournament_n):
115111
"""Returns the n_of_parents individuals with the best fitness"""
116112

117113
parents = []
118-
for _ in xrange(mu):
114+
for _ in range(mu):
119115
winner = _choice(population)
120-
for _ in xrange(tournament_n - 1):
116+
for _ in range(tournament_n - 1):
121117
individual = _choice(population)
122118
# Save winner is element with smallest fitness
123119
if individual.ibea_fitness < winner.ibea_fitness:

bluepyopt/ephys/serializer.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
'''Mixin class to make dictionaries'''
2-
from __future__ import unicode_literals
3-
from __future__ import print_function
4-
from __future__ import division
5-
from __future__ import absolute_import
62

73
# Disabling lines below, generate error when loading ephys.examples
84
# from future import standard_library

bluepyopt/ipyp/bpopt_tasksdb.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""Get stats out of ipyparallel's tasks.db"""
22

3-
from __future__ import print_function
4-
53
"""
64
Copyright (c) 2016-2020, EPFL/Blue Brain Project
75

examples/graupnerbrunelstdp/run_fit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# pylint: disable=R0914
44

5-
from __future__ import print_function
6-
75
import pickle
86
import bluepyopt as bpop
97
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)