Skip to content

Commit

Permalink
Move CSA tests to integration
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Nov 3, 2023
1 parent cd7fc60 commit e0523b7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 113 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ simple_example.png
*.data
*.data2
*.csv
/.mypy_cache/
22 changes: 20 additions & 2 deletions spynnaker_integration_tests/test_connectors/test_csa_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,27 @@ def do_csa_nd_test(

assert numpy.array_equal(numpy.sort(full_cset, axis=0),
numpy.sort(conns, axis=0))
return conns

def test_1d(self):
self.do_csa_nd_test(4, 25, None, 6, 35, None, csa.oneToOne)
def test_1d_one_to_one(self):
conns = self.do_csa_nd_test(4, 25, None, 6, 35, None, csa.oneToOne)
assert all(i == j for (i, j) in conns)

def test_1d_from_list(self):
conns = self.do_csa_nd_test(
4, 10, None, 6, 10, None, [(i, i + 1 % 10) for i in range(10)])
assert all(j == i + 1 % 10 for (i, j) in conns)

def test_1d_random(self):
conns = self.do_csa_nd_test(
4, 10, None, 6, 10, None, csa.random(0.05))
assert len(conns) > 0

def test_1d_block_random(self):
conns = self.do_csa_nd_test(
3, 10, None, 4, 10, None,
csa.block(2, 5) * csa.random(0.5) * csa.random(0.3))
assert len(conns) > 0

def test_2d(self):
self.do_csa_nd_test(
Expand Down
111 changes: 0 additions & 111 deletions unittests/connector_tests/test_csa_connector.py

This file was deleted.

0 comments on commit e0523b7

Please sign in to comment.