Skip to content

Commit

Permalink
Correctly write equations for Brian2 when creating a point neuron wit…
Browse files Browse the repository at this point in the history
…h no synapses
  • Loading branch information
apdavison committed May 17, 2024
1 parent 6dec649 commit 0018f27
Showing 1 changed file with 12 additions and 9 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

0 comments on commit 0018f27

Please sign in to comment.