diff --git a/pyNN/brian2/standardmodels/cells.py b/pyNN/brian2/standardmodels/cells.py index 43427dc3..b5512cd0 100644 --- a/pyNN/brian2/standardmodels/cells.py +++ b/pyNN/brian2/standardmodels/cells.py @@ -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 diff --git a/pyNN/neuron/cells.py b/pyNN/neuron/cells.py index 742e1d28..bd0ad98f 100644 --- a/pyNN/neuron/cells.py +++ b/pyNN/neuron/cells.py @@ -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') @@ -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')