diff --git a/pyNN/nest/standardmodels/cells.py b/pyNN/nest/standardmodels/cells.py index aeb7ffb2..f149453b 100644 --- a/pyNN/nest/standardmodels/cells.py +++ b/pyNN/nest/standardmodels/cells.py @@ -74,6 +74,8 @@ class IF_curr_delta(cells.IF_curr_delta): ('v_thresh', 'V_th'), ('i_offset', 'I_e', 1000.0), # I_e is in pA, i_offset in nA ) + variable_map = {'v': 'V_m'} + scale_factors = {'v': 1} # extra parameters in the NEST model # V_min mV Absolute lower value for the membrane potenial # refractory_input boolean If true, do not discard input during diff --git a/test/system/scenarios/test_cell_types.py b/test/system/scenarios/test_cell_types.py index 3e1bc0f3..f7849555 100644 --- a/test/system/scenarios/test_cell_types.py +++ b/test/system/scenarios/test_cell_types.py @@ -297,6 +297,32 @@ def test_update_SpikeSourceArray(sim, plot_figure=False): assert_array_equal(data[0].magnitude, np.array([12, 15, 18, 22, 25])) +@run_with_simulators("nest", "brian2") +def test_IF_curr_delta_voltage_step(sim): + """A single delta-synapse input steps V by the weight (mV). + + Guards the Arbor weight scaling: a lif_cell delta event adds weight/C_m to + V_m, so the connection weight is scaled by C_m to recover PyNN's mV step. + """ + sim.setup(timestep=0.1) + v_rest = -65.0 + weight = 5.0 # mV voltage step + source = sim.Population(1, sim.SpikeSourceArray(spike_times=[20.0])) + cell = sim.Population(1, sim.IF_curr_delta( + v_rest=v_rest, v_reset=v_rest, v_thresh=-40.0, + tau_m=20.0, cm=1.0, tau_refrac=0.1), + initial_values={'v': v_rest}) + sim.Projection(source, cell, sim.AllToAllConnector(), + sim.StaticSynapse(weight=weight, delay=1.0), + receptor_type="excitatory") + cell.record('v') + sim.run(60.0) + v = cell.get_data().segments[0].filter(name='v')[0].magnitude[:, 0] + step = v.max() - v_rest + assert abs(step - weight) < 1e-12, step + sim.end() + + @run_with_simulators("nest", "neuron", "brian2") def test_composed_neuron_model_homogeneous_receptors(sim, plot_figure=False): sim.setup()