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

Commit 890c14e

Browse files
authored
Merge pull request #456 from BlueBrain/fix_issue_423
Fix issue #423
2 parents 9567299 + d3ce73b commit 890c14e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

examples/tsodyksmarkramstp/tmevaluator.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
55
@author: Giuseppe Chindemi
66
@remark: Copyright (c) 2017, EPFL/Blue Brain Project
7-
This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
8-
This library is free software; you can redistribute it and/or modify it
9-
under the terms of the GNU Lesser General Public License version 3.0 as
10-
published by the Free Software Foundation.
7+
This file is part of BluePyOpt
8+
<https://github.com/BlueBrain/BluePyOpt>
9+
This library is free software; you can redistribute it and/or modify
10+
it under the terms of the GNU Lesser General Public License version
11+
3.0 as published by the Free Software Foundation.
1112
This library is distributed in the hope that it will be useful, but
1213
WITHOUT ANY WARRANTY; without even the implied warranty of
1314
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -48,27 +49,27 @@ def __init__(self, t, v, tstim, params):
4849
self.stimidx = np.searchsorted(t, tstim)
4950
self.dx = t[1] - t[0]
5051
self.nsamples = len(v)
51-
self.params = params
5252
# Find voltage baseline
5353
bs_stop = np.searchsorted(t, tstim[0])
5454
self.vrest = np.mean(v[:bs_stop])
5555
# Compute time windows where to compare model and data
5656
offset = 0.005 # s
5757
window = 0.04 # s
58-
window_samples = int(np.round(window/self.dx))
59-
psp_start = np.searchsorted(t, tstim+offset)
58+
window_samples = int(np.round(window / self.dx))
59+
psp_start = np.searchsorted(t, tstim + offset)
6060
psp_stop = psp_start + window_samples
61-
psp_stop[-1] += 2*window_samples # Extend last psp window (RTR case)
61+
psp_stop[-1] += 2 * window_samples # Extend last psp window (RTR case)
6262
self.split_idx = list(zip(psp_start, psp_stop))
6363
# Parameters to be optimized
6464
self.params = [bpop.parameters.Parameter(name, bounds=(minval, maxval))
65-
for name, minval, maxval in self.params]
65+
for name, minval, maxval in params]
6666
# Objectives
6767
self.objectives = [bpop.objectives.Objective('interval_%d' % (i,))
6868
for i in xrange(len(self.split_idx))]
6969

7070
def generate_model(self, individual):
71-
"""Calls numerical integrator `tmodeint.py` and returns voltage trace based on the input parameters"""
71+
"""Calls numerical integrator `tmodeint.py` and returns voltage trace
72+
based on the input parameters"""
7273

7374
v, _ = tmodeint.integrate(self.stimidx, self.nsamples, self.dx,
7475
self.vrest, *individual)

0 commit comments

Comments
 (0)