Skip to content

Commit f856ce4

Browse files
committed
Include connections from generators in test
1 parent 3fdea73 commit f856ce4

5 files changed

+19
-316
lines changed

testsuite/mpitests/topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_source.sli

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

testsuite/mpitests/topo_mpi_test_free_pg_to_layer_pairwise_bernoulli_on_target.sli

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

testsuite/mpitests/topo_mpi_test_free_pg_to_layer_source_driven.sli

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

testsuite/mpitests/topo_mpi_test_free_pg_to_layer_target_driven.sli

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

testsuite/pytests/sli2py_mpi/test_spatial_connections.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,24 @@
2222
import pytest
2323
from 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
[
@@ -43,7 +57,7 @@
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

Comments
 (0)