Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix point neuron problems with pyNN.neuron and pyNN.brian2 modules #800

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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