Skip to content

Commit

Permalink
Merge pull request #473 from BlueBrain/removefuture
Browse files Browse the repository at this point in the history
remove __future__ imports
  • Loading branch information
AurelienJaquier authored Oct 12, 2023
2 parents f7fd66d + 8c8fb4b commit a263ade
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 2,281 deletions.
10 changes: 3 additions & 7 deletions bluepyopt/deapext/tools/selIBEA.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
"""IBEA selector"""

from __future__ import division

from past.builtins import xrange # pylint: disable=W0622

"""
Copyright (c) 2016-2022, EPFL/Blue Brain Project
Expand Down Expand Up @@ -77,7 +73,7 @@ def _calc_fitness_components(population, kappa):
box_ranges[box_ranges == 0] = 1.0

components_matrix = numpy.zeros((pop_len, pop_len))
for i in xrange(0, pop_len):
for i in range(0, pop_len):
diff = population_matrix - population_matrix[i, :]
components_matrix[i, :] = numpy.max(
numpy.divide(diff, box_ranges),
Expand Down Expand Up @@ -115,9 +111,9 @@ def _mating_selection(population, mu, tournament_n):
"""Returns the n_of_parents individuals with the best fitness"""

parents = []
for _ in xrange(mu):
for _ in range(mu):
winner = _choice(population)
for _ in xrange(tournament_n - 1):
for _ in range(tournament_n - 1):
individual = _choice(population)
# Save winner is element with smallest fitness
if individual.ibea_fitness < winner.ibea_fitness:
Expand Down
4 changes: 0 additions & 4 deletions bluepyopt/ephys/serializer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'''Mixin class to make dictionaries'''
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# Disabling lines below, generate error when loading ephys.examples
# from future import standard_library
Expand Down
2 changes: 0 additions & 2 deletions bluepyopt/ipyp/bpopt_tasksdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Get stats out of ipyparallel's tasks.db"""

from __future__ import print_function

"""
Copyright (c) 2016-2020, EPFL/Blue Brain Project
Expand Down
2 changes: 0 additions & 2 deletions examples/graupnerbrunelstdp/run_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# pylint: disable=R0914

from __future__ import print_function

import pickle
import bluepyopt as bpop
import matplotlib.pyplot as plt
Expand Down
Loading

0 comments on commit a263ade

Please sign in to comment.