2222import pytest
2323from mpi_test_wrapper import MPITestAssertEqual
2424
25+ """
26+ Confirm that spatial connections are created consistently for fixed VP.
27+
28+ This test is parameterized at three levels:
29+ - Neuron and generator as source
30+ - Free and grid layers
31+ - Different spatial connection rules
32+
33+ Connections to recorders are handled in a separate test, as they do not work
34+ with fixed_indegree and there is no elegant way of filtering that case out.
35+ """
36+
2537
2638# We cannot use nest or numpy outside the test function itself, so we need to create
2739# the free positions with basic Python commands.
2840@pytest .mark .skipif_incompatible_mpi
41+ @pytest .mark .skipif_missing_threads
42+ @pytest .mark .parametrize ("source_model" , ["poisson_generator" , "parrot_neuron" ])
2943@pytest .mark .parametrize (
3044 "geometry" ,
3145 [
4357 ],
4458)
4559@MPITestAssertEqual ([1 , 2 , 4 ], debug = False )
46- def test_spatial_connections (geometry , conn_spec ):
60+ def test_spatial_connections (source_model , geometry , conn_spec ):
4761 """
4862 Confirm that spatial connections are created consistently for fixed VP.
4963
@@ -63,11 +77,12 @@ def test_spatial_connections(geometry, conn_spec):
6377 else :
6478 assert kind == "grid"
6579 pos = nest .spatial .grid (** specs )
66- lyr = nest .Create ("parrot_neuron" , positions = pos )
80+ source_layer = nest .Create (source_model , positions = pos )
81+ target_layer = nest .Create ("parrot_neuron" , positions = pos )
6782
6883 nest .Connect (
69- lyr ,
70- lyr ,
84+ source_layer ,
85+ target_layer ,
7186 {** conn_spec , "mask" : {"circular" : {"radius" : 2.5 }}},
7287 {
7388 "weight" : nest .spatial_distributions .gaussian (10 * nest .spatial .distance , std = 2 ),
0 commit comments