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

Commit 4148974

Browse files
committed
Renaming Arbor iexpr module, adding docstring
1 parent 9dd09e6 commit 4148974

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

bluepyopt/ephys/parameterscalers/arbor_dsl.py renamed to bluepyopt/ephys/parameterscalers/acc_iexpr.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Module that generates Arbor's iexpr expression language."""
1+
"""Translate spatially varying parameter-scaler expressions to Arbor iexprs"""
22

33
"""
44
Copyright (c) 2016-2022, EPFL/Blue Brain Project
@@ -218,8 +218,18 @@ def visit_Name(self, node):
218218
' No valid substitution for %s.' % node.id)
219219

220220

221-
def generate_arbor_iexpr(iexpr, variables, constant_formatter):
222-
"""Generate Arbor iexpr from parameter-scaler python expression"""
221+
def generate_acc_scale_iexpr(iexpr, variables, constant_formatter):
222+
"""Translate parameter-scaler python arithmetic expression to Arbor iexpr
223+
224+
Args:
225+
iexpr (str): Python arithmetic expression (instantiated distribution)
226+
variables (): Mapping of variable name (referenced in the iexpr
227+
argument) to Arbor iexpr representation
228+
229+
Returns:
230+
The Arbor iexpr corresponding to the python arithmetic expression
231+
with the variables substituted by their value.
232+
"""
223233

224234
if 'value' not in variables:
225235
raise ValueError('Arbor iexpr generation failed for %s:' % iexpr +

bluepyopt/ephys/parameterscalers/parameterscalers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import string
2525

2626
from bluepyopt.ephys.base import BaseEPhys
27-
from bluepyopt.ephys.parameterscalers.arbor_dsl import generate_arbor_iexpr
27+
from bluepyopt.ephys.parameterscalers.acc_iexpr import generate_acc_scale_iexpr
2828
from bluepyopt.ephys.serializer import DictMixin
2929
from bluepyopt.ephys.morphologies import ArbFileMorphology
3030

@@ -190,7 +190,7 @@ def acc_scale_iexpr(self, value, constant_formatter=format_float):
190190
distance='(distance %s)' % # could be a ctor param if required
191191
ArbFileMorphology.region_labels['somatic'].ref
192192
)
193-
return generate_arbor_iexpr(iexpr, variables, constant_formatter)
193+
return generate_acc_scale_iexpr(iexpr, variables, constant_formatter)
194194

195195
def __str__(self):
196196
"""String representation"""

0 commit comments

Comments
 (0)