Skip to content

Commit 7fed97f

Browse files
committed
Port issue-281.sli to python
1 parent 3b6cf67 commit 7fed97f

File tree

3 files changed

+58
-63
lines changed

3 files changed

+58
-63
lines changed

testsuite/mpitests/issue-281.sli

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

testsuite/pytests/sli2py_mpi/mpi_test_wrapper.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,14 @@ def assert_correct_results(self, tmpdirpath):
275275

276276
for r in res[1:]:
277277
pd.testing.assert_frame_equal(res[0], r)
278+
279+
280+
class MPITestAssertCompletes(MPITestWrapper):
281+
"""
282+
Test class that just confirms that the test code completes.
283+
284+
Therefore, no testing to be done on any results.
285+
"""
286+
287+
def assert_correct_results(self, tmpdirpath):
288+
pass
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# test_issue_2119.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+
23+
import pandas as pd
24+
import pytest
25+
from mpi_test_wrapper import MPITestAssertCompletes
26+
27+
28+
@MPITestAssertCompletes([1, 2, 4])
29+
def test_issue_281():
30+
"""
31+
Confirm that ConnectLayers works MPI-parallel for fixed fan-out.
32+
"""
33+
34+
import nest
35+
import pandas as pd
36+
37+
l = nest.Create("parrot_neuron", positions=nest.spatial.grid(shape=[3, 3]))
38+
nest.Connect(
39+
l,
40+
l,
41+
{"rule": "fixed_indegree", "indegree": 8, "allow_multapses": False, "allow_autapses": False},
42+
# weights are randomized to check that global RNGs stay in sync
43+
{"weight": nest.random.uniform(min=1, max=2)},
44+
)
45+
46+
# Ensure by simulation that global RNGs are still in sync
47+
nest.Simulate(10)

0 commit comments

Comments
 (0)