Skip to content

Commit ae4fcf6

Browse files
convert with cursor
1 parent 31256b9 commit ae4fcf6

File tree

2 files changed

+54
-63
lines changed

2 files changed

+54
-63
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# test_ticket_716.py
4+
#
5+
# This file is part of NEST.
6+
#
7+
# Copyright (C) 2004 The NEST Initiative
8+
#
9+
# NEST is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation, either version 2 of the License, or
12+
# (at your option) any later version.
13+
#
14+
# NEST is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with NEST. If not, see <http://www.gnu.org/licenses/>.
21+
22+
import nest
23+
import pytest
24+
25+
26+
def test_stdp_dopamine_synapse_weight_constant_without_presynaptic_spikes():
27+
"""
28+
Regression test for Ticket #716.
29+
30+
Ensure that the weight of an stdp_dopamine_synapse is constant in the absence of presynaptic spiking.
31+
"""
32+
nest.ResetKernel()
33+
vt = nest.Create("volume_transmitter")
34+
nest.SetDefaults("stdp_dopamine_synapse", {"volume_transmitter": vt[0]})
35+
36+
n_pre = nest.Create("parrot_neuron") # does not fire
37+
n_post = nest.Create("parrot_neuron")
38+
n_dopa = nest.Create("parrot_neuron")
39+
40+
sg_post = nest.Create("spike_generator", params={"spike_times": [0.5, 1.1, 3.4]})
41+
sg_dopa = nest.Create("spike_generator", params={"spike_times": [1.4, 2.3, 4.6]})
42+
43+
nest.Connect(n_pre, n_post, syn_spec="stdp_dopamine_synapse")
44+
nest.Connect(sg_dopa, n_dopa)
45+
nest.Connect(n_dopa, vt)
46+
nest.Connect(sg_post, n_post)
47+
48+
# Get initial weight
49+
conns = nest.GetConnections(synapse_model="stdp_dopamine_synapse")
50+
w0 = conns.get("weight")
51+
nest.Simulate(10.0)
52+
w1 = conns.get("weight")
53+
54+
assert abs(w0 - w1) <= 1e-13, f"Weight changed: w0={w0}, w1={w1}"

testsuite/regressiontests/ticket-716.sli

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)