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

Commit 4246f6a

Browse files
authored
Merge pull request #433 from AurelienJaquier/fix-lfpy
Fix parameterscalers
2 parents 0ac3c5a + e5ed68a commit 4246f6a

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

bluepyopt/deapext/tools/selIBEA.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _calc_fitness_components(population, kappa):
6363
population_matrix = numpy.fromiter(
6464
iter(-x for individual in population
6565
for x in individual.fitness.wvalues),
66-
dtype=numpy.float)
66+
dtype=numpy.float64)
6767
pop_len = len(population)
6868
feat_len = len(population[0].fitness.wvalues)
6969
population_matrix = population_matrix.reshape((pop_len, feat_len))

bluepyopt/ephys/efeatures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def _filter_response(response, fcut=[0.5, 6000], order=2, filt_type="lfilter"):
563563

564564
trace = response["voltage"]
565565

566-
if isinstance(fcut, (float, int, np.float, np.integer)):
566+
if isinstance(fcut, (float, int, np.floating, np.integer)):
567567
btype = "highpass"
568568
band = fcut / fn
569569
else:

bluepyopt/ephys/extra_features_utils.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
"""Extra features functions"""
2+
3+
"""
4+
Copyright (c) 2016-2020, EPFL/Blue Brain Project
5+
6+
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
7+
8+
This library is free software; you can redistribute it and/or modify it under
9+
the terms of the GNU Lesser General Public License version 3.0 as published
10+
by the Free Software Foundation.
11+
12+
This library is distributed in the hope that it will be useful, but WITHOUT
13+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14+
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15+
details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with this library; if not, write to the Free Software Foundation, Inc.,
19+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20+
"""
21+
122
import numpy as np
223

324
all_1D_features = [
@@ -278,7 +299,7 @@ def repolarization_slope(waveforms, sampling_frequency, return_idx=False):
278299

279300
rslope = np.empty(waveforms.shape[0])
280301
rslope[:] = np.nan
281-
return_to_base_idx = np.empty(waveforms.shape[0], dtype=np.int)
302+
return_to_base_idx = np.empty(waveforms.shape[0], dtype=np.int_)
282303
return_to_base_idx[:] = 0
283304

284305
time = np.arange(0, waveforms.shape[1]) * (1 / sampling_frequency) # in s

bluepyopt/ephys/parameterscalers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def scale(self, values, segment, sim=None):
178178

179179
# find section
180180
target_sec = None
181-
for sec in sim.neuron.h.allsec():
181+
for sec in segment.sec.wholetree():
182182
if "." in sec.name(): # deal with templates
183183
sec_name = sec.name().split(".")[1]
184184
else:

bluepyopt/ipyp/bpopt_tasksdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def plot_duration_histogram(tasks):
9898
durations = np.fromiter((t['duration']
9999
for task_list in tasks.values()
100100
for t in task_list),
101-
dtype=np.float)
101+
dtype=np.float64)
102102
plt.hist(durations, 100)
103103

104104
plt.xlabel('Duration (s)')

0 commit comments

Comments
 (0)