Skip to content

Commit

Permalink
A few more lint fixes for the fixed route router
Browse files Browse the repository at this point in the history
  • Loading branch information
dkfellows committed Oct 4, 2019
1 parent 48a8d10 commit 0379369
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
5 changes: 0 additions & 5 deletions pacman/operations/algorithms_metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@
<param_name>destination_class</param_name>
<param_type>FixedRouteDestinationClass</param_type>
</parameter>
<parameter>
<param_name>board_version</param_name>
<param_type>BoardVersion</param_type>
</parameter>
</input_definitions>
<required_inputs>
<param_name>placements</param_name>
<param_name>machine</param_name>
<param_name>board_version</param_name>
<param_name>destination_class</param_name>
</required_inputs>
<outputs>
Expand Down
3 changes: 1 addition & 2 deletions pacman/operations/fixed_route_router/fixed_route_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ class FixedRouteRouter(object):
"_destination_class", "_fixed_route_tables",
"_machine", "_placements"]

def __call__(self, machine, placements, board_version, destination_class):
def __call__(self, machine, placements, destination_class):
""" Runs the fixed route generator for all boards on machine
:param machine: SpiNNMachine object
:param placements: placements object
:param board_version: to be nuked
:param destination_class: the destination class to route packets to
:return: router tables for fixed route paths
"""
Expand Down
21 changes: 7 additions & 14 deletions unittests/test_fixed_route_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def _check_setup(width, height, down_chips, down_links):
Placement(DestinationVertex(), ethernet_chip.x, ethernet_chip.y, 1)
for ethernet_chip in ethernet_chips)

fixed_route_tables = router(
machine, placements, "bacon", DestinationVertex)
fixed_route_tables = router(machine, placements, DestinationVertex)

for x, y in machine.chip_coordinates:
assert (x, y) in fixed_route_tables
Expand All @@ -80,9 +79,7 @@ def _check_setup(width, height, down_chips, down_links):
(False, True),
(True, True)])
def test_all_working(width, height, with_down_links, with_down_chips):

temp_machine = virtual_machine(
width=width, height=height)
temp_machine = virtual_machine(width=width, height=height)
down_links = None
if with_down_links:
down_links = set()
Expand All @@ -106,15 +103,11 @@ def test_unreachable():


if __name__ == '__main__':
iterations = [
_iterations = [
(False, False),
(True, False),
(False, True)]
for (_x, _y) in iterations:
test_all_working(2, 2, None, 3, _x, _y)
test_all_working(2, 2, None, 3, _x, _y)
test_all_working(None, None, 3, 3, _x, _y)
test_all_working(8, 8, None, 5, _x, _y)
test_all_working(None, None, 5, 5, _x, _y)
test_all_working(12, 12, None, 5, _x, _y)
test_all_working(16, 16, None, 5, _x, _y)
_sizes = [2, 8, 12, 16]
for (_down_links, _down_chips) in _iterations:
for _size in _sizes:
test_all_working(_size, _size, _down_links, _down_chips)

0 comments on commit 0379369

Please sign in to comment.