Skip to content

Commit 7cae37d

Browse files
committed
don't use getter directly
1 parent 476b700 commit 7cae37d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pynest/examples/wang_decision_making.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def run_sim(coherence, seed=123):
207207
##################################################
208208
# Define synapse specifications
209209

210-
receptor_types = selective_pop1[0].get("receptor_types")
210+
receptor_types = selective_pop1[0].receptor_types
211211

212212
syn_spec_pot_AMPA = {
213213
"synapse_model": "static_synapse",

testsuite/pytests/test_iaf_bw_2001.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_iaf_bw_2001():
107107
postsyn_bw2 = nest.Create("iaf_bw_2001", wang_params)
108108
postsyn_ce = nest.Create("iaf_cond_exp", cond_exp_params)
109109

110-
receptor_types = nrn_presyn.get("receptor_types")
110+
receptor_types = nrn_presyn.receptor_types
111111

112112
pg = nest.Create("poisson_generator", {"rate": 50.0})
113113
sr = nest.Create("spike_recorder", {"time_in_steps": True})
@@ -150,7 +150,7 @@ def test_iaf_bw_2001():
150150
first_spike_ind = int(spikes[0] / nest.resolution)
151151

152152
# compute analytical solutions
153-
times = mm_presyn.get("events", "times") * nest.resolution
153+
times = mm_presyn.events["times"] * nest.resolution
154154
ampa_soln = spiketrain_response(times, wang_params["tau_AMPA"], spikes, w_ex)
155155
gaba_soln = spiketrain_response(times, wang_params["tau_GABA"], spikes, np.abs(w_in))
156156

@@ -191,7 +191,7 @@ def test_approximation_I_NMDA_V_m():
191191
nrn_approx = nest.Create("iaf_bw_2001", nrn_params)
192192
nrn_exact = nest.Create("iaf_bw_2001_exact", nrn_params)
193193

194-
receptor_types = nrn_presyn.get("receptor_types")
194+
receptor_types = nrn_presyn.receptor_types
195195

196196
pg = nest.Create("poisson_generator", {"rate": 150.0})
197197
sr = nest.Create("spike_recorder", {"time_in_steps": True})
@@ -228,7 +228,7 @@ def test_illegal_connection_error():
228228
nest.ResetKernel()
229229
nrn_ce = nest.Create("iaf_cond_exp")
230230
nrn_bw = nest.Create("iaf_bw_2001")
231-
receptor_types = nrn_bw.get("receptor_types")
231+
receptor_types = nrn_bw.receptor_types
232232
nmda_syn_spec = {"receptor_type": receptor_types["NMDA"]}
233233
with pytest.raises(nest.kernel.NESTErrors.IllegalConnection):
234234
nest.Connect(nrn_ce, nrn_bw, syn_spec=nmda_syn_spec)

testsuite/pytests/test_iaf_bw_2001_exact.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_iaf_bw_2001_exact():
101101
bw_postsyn_2 = nest.Create("iaf_bw_2001_exact", wang_params)
102102
cond_exp_postsyn = nest.Create("iaf_cond_exp", cond_exp_params)
103103

104-
receptor_types = bw_presyn.get("receptor_types")
104+
receptor_types = bw_presyn.receptor_types
105105

106106
pg = nest.Create("poisson_generator", {"rate": 50.0})
107107
sr = nest.Create("spike_recorder", {"time_in_steps": True})
@@ -144,7 +144,7 @@ def test_iaf_bw_2001_exact():
144144
first_spike_ind = int(spikes[0] / nest.resolution)
145145

146146
# compute analytical solutions
147-
times = mm_presyn.get("events", "times") * nest.resolution
147+
times = mm_presyn.events["times"] * nest.resolution
148148
ampa_soln = spiketrain_response(times, wang_params["tau_AMPA"], spikes, w_ex)
149149
gaba_soln = spiketrain_response(times, wang_params["tau_GABA"], spikes, np.abs(w_in))
150150

@@ -164,7 +164,7 @@ def test_connect_NMDA_after_simulate():
164164
presyn = nest.Create("iaf_bw_2001_exact")
165165
postsyn = nest.Create("iaf_bw_2001_exact")
166166

167-
receptor_types = presyn.get("receptor_types")
167+
receptor_types = presyn.receptor_types
168168
nmda_syn_spec = {"weight": 1.0, "receptor_type": receptor_types["NMDA"]}
169169

170170
nest.Connect(presyn, postsyn, syn_spec=nmda_syn_spec)

0 commit comments

Comments
 (0)