Skip to content

Commit 1a1ce5c

Browse files
authored
Merge pull request #800 from apdavison/fix-point-neuron
Fix point neuron problems with pyNN.neuron and pyNN.brian2 modules
2 parents 5b6af57 + 0018f27 commit 1a1ce5c

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

pyNN/brian2/standardmodels/cells.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,18 @@ def __init__(self, neuron, **post_synaptic_receptors):
332332
self.translations = deepcopy(neuron.translations)
333333
self.state_variable_translations = neuron.state_variable_translations
334334
self.post_synaptic_variables = {}
335-
synaptic_current_equation = "i_syn ="
336-
for psr_label, psr in post_synaptic_receptors.items():
337-
self.eqs += psr.eqs(psr_label)
338-
self.translations.update(psr.translations(psr_label))
339-
self.state_variable_translations.update(psr.state_variable_translations(psr_label))
340-
self.post_synaptic_variables.update({psr_label: psr.post_synaptic_variable(psr_label)})
341-
synaptic_current_equation += f" {psr.synaptic_current(psr_label)} +"
342-
synaptic_current_equation = synaptic_current_equation.strip("+")
343-
synaptic_current_equation += " : amp"
335+
if post_synaptic_receptors:
336+
synaptic_current_equation = "i_syn ="
337+
for psr_label, psr in post_synaptic_receptors.items():
338+
self.eqs += psr.eqs(psr_label)
339+
self.translations.update(psr.translations(psr_label))
340+
self.state_variable_translations.update(psr.state_variable_translations(psr_label))
341+
self.post_synaptic_variables.update({psr_label: psr.post_synaptic_variable(psr_label)})
342+
synaptic_current_equation += f" {psr.synaptic_current(psr_label)} +"
343+
synaptic_current_equation = synaptic_current_equation.strip("+")
344+
synaptic_current_equation += " : amp"
345+
else:
346+
synaptic_current_equation = "i_syn = 0*amp : amp"
344347
self.eqs += brian2.Equations(synaptic_current_equation)
345348
self.brian2_model = neuron.brian2_model
346349

pyNN/neuron/cells.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def __init__(self, tau_m=20, c_m=1.0, v_rest=-65,
218218

219219
# process arguments
220220
self.parameters.update(v_thresh=v_thresh, t_refrac=t_refrac, v_reset=v_reset)
221+
self.set_parameters()
221222

222223
v_thresh = _new_property('spike_reset', 'vthresh')
223224
v_reset = _new_property('spike_reset', 'vreset')
@@ -252,7 +253,7 @@ def __init__(self, tau_m=20, c_m=1.0, v_rest=-65, v_thresh=-55, t_refrac=2,
252253
for name in ('v_thresh', 't_refrac', 'v_reset',
253254
'A', 'B', 'tau_w', 'delta', 'v_spike'):
254255
self.parameters[name] = local_params[name]
255-
256+
self.set_parameters()
256257
self.w_init = None
257258

258259
v_thresh = _new_property('adexp', 'vthresh')

0 commit comments

Comments
 (0)