Skip to content

Commit d0f044a

Browse files
Merge pull request #235 from NeuroML/feat/if-curve-allow-specifying-segment
feat(generate-if-curve): allow specifying segment and fraction along
2 parents 8b2d46f + 10f1de8 commit d0f044a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pyneuroml/analysis/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ def generate_current_vs_frequency_curve(
5757
title_above_plot: bool = False,
5858
return_axes: bool = False,
5959
verbose: bool = False,
60+
segment_id: typing.Optional[str] = None,
61+
fraction_along: typing.Optional[float] = None
6062
):
6163
"""Generate current vs firing rate frequency curve for provided cell.
6264
@@ -142,6 +144,10 @@ def generate_current_vs_frequency_curve(
142144
:param return_axes: toggle whether plotting axis should be returned.
143145
This is useful if one wants to overlay more graphs in the same plot.
144146
:type return_axes: bool
147+
:param segment_id: segment id to attach input to
148+
:type segment_id: str
149+
:param fraction_along: fraction along on segment to attach to
150+
:type fraction_along: float
145151
:param verbose:
146152
:type verbose:
147153
@@ -223,10 +229,12 @@ def generate_current_vs_frequency_curve(
223229

224230
# Add these to cells
225231
input_list = nml.InputList(id=input_id, component=pg.id, populations=pop.id)
226-
input = nml.Input(
227-
id="0", target="../%s[%i]" % (pop.id, i), destination="synapses"
232+
aninput = nml.Input(
233+
id="0", target="../%s[%i]" % (pop.id, i), destination="synapses",
234+
segment_id=segment_id, fraction_along=fraction_along
228235
)
229-
input_list.input.append(input)
236+
input_list.input.append(aninput)
237+
230238
net.input_lists.append(input_list)
231239

232240
net_file_name = "%s.net.nml" % sim_id

0 commit comments

Comments
 (0)