Skip to content

Commit

Permalink
Merge pull request #800 from apdavison/fix-point-neuron
Browse files Browse the repository at this point in the history
Fix point neuron problems with pyNN.neuron and pyNN.brian2 modules
  • Loading branch information
apdavison authored May 17, 2024
2 parents 5b6af57 + 0018f27 commit 1a1ce5c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 12 additions & 9 deletions pyNN/brian2/standardmodels/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,18 @@ def __init__(self, neuron, **post_synaptic_receptors):
self.translations = deepcopy(neuron.translations)
self.state_variable_translations = neuron.state_variable_translations
self.post_synaptic_variables = {}
synaptic_current_equation = "i_syn ="
for psr_label, psr in post_synaptic_receptors.items():
self.eqs += psr.eqs(psr_label)
self.translations.update(psr.translations(psr_label))
self.state_variable_translations.update(psr.state_variable_translations(psr_label))
self.post_synaptic_variables.update({psr_label: psr.post_synaptic_variable(psr_label)})
synaptic_current_equation += f" {psr.synaptic_current(psr_label)} +"
synaptic_current_equation = synaptic_current_equation.strip("+")
synaptic_current_equation += " : amp"
if post_synaptic_receptors:
synaptic_current_equation = "i_syn ="
for psr_label, psr in post_synaptic_receptors.items():
self.eqs += psr.eqs(psr_label)
self.translations.update(psr.translations(psr_label))
self.state_variable_translations.update(psr.state_variable_translations(psr_label))
self.post_synaptic_variables.update({psr_label: psr.post_synaptic_variable(psr_label)})
synaptic_current_equation += f" {psr.synaptic_current(psr_label)} +"
synaptic_current_equation = synaptic_current_equation.strip("+")
synaptic_current_equation += " : amp"
else:
synaptic_current_equation = "i_syn = 0*amp : amp"
self.eqs += brian2.Equations(synaptic_current_equation)
self.brian2_model = neuron.brian2_model

Expand Down
3 changes: 2 additions & 1 deletion pyNN/neuron/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def __init__(self, tau_m=20, c_m=1.0, v_rest=-65,

# process arguments
self.parameters.update(v_thresh=v_thresh, t_refrac=t_refrac, v_reset=v_reset)
self.set_parameters()

v_thresh = _new_property('spike_reset', 'vthresh')
v_reset = _new_property('spike_reset', 'vreset')
Expand Down Expand Up @@ -252,7 +253,7 @@ def __init__(self, tau_m=20, c_m=1.0, v_rest=-65, v_thresh=-55, t_refrac=2,
for name in ('v_thresh', 't_refrac', 'v_reset',
'A', 'B', 'tau_w', 'delta', 'v_spike'):
self.parameters[name] = local_params[name]

self.set_parameters()
self.w_init = None

v_thresh = _new_property('adexp', 'vthresh')
Expand Down

0 comments on commit 1a1ce5c

Please sign in to comment.