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

Commit 635528f

Browse files
author
Jaquier Aurélien Tristan
committed
Use step_begin, step_end when exporting to hoc if present
1 parent 130d990 commit 635528f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bluepyopt/ephys/create_hoc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ def range_exprs_to_hoc(range_params):
108108
value = re.sub(r'\&', '&&', value)
109109
value = re.sub('{distance}', FLOAT_FORMAT, value)
110110
value = re.sub('{value}', format_float(param.value), value)
111+
if hasattr(param.value_scaler, "step_begin"):
112+
value = re.sub('{step_begin}', format_float(param.value_scaler.step_begin), value)
113+
value = re.sub('{step_end}', format_float(param.value_scaler.step_end), value)
111114
ret.append(Range(param.location, param.name, value))
112115
return ret
113116

bluepyopt/ephys/parameterscalers/parameterscalers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def inst_distribution(self):
162162
return string.Formatter().vformat(self.distribution, (), dist_dict)
163163

164164
def scale_dict(self, values, distance):
165-
"""Create scale disctionary"""
165+
"""Create scale dictionary"""
166166
scale_dict = {}
167167
if isinstance(values, dict):
168168
for k, v in values.items():
@@ -204,7 +204,6 @@ def scale(self, values, segment, sim=None):
204204

205205
# Find something to generalise this
206206
import math # pylint:disable=W0611 #NOQA
207-
import numpy
208207

209208
# This eval is unsafe (but is it ever dangerous ?)
210209
# pylint: disable=W0123
@@ -290,7 +289,7 @@ def __init__(
290289
distribution (str): distribution of parameter dependent on distance
291290
from soma. string can contain `distance` and/or `value` as
292291
placeholders for the distance to the soma and parameter value
293-
respectivily
292+
respectivily. It can also contain step_begin and step_end.
294293
dist_param_names (list): list of names of parameters that
295294
parametrise the distribution. These names will become
296295
attributes of this object.

0 commit comments

Comments
 (0)