Skip to content

Commit

Permalink
Merge pull request #350 from SpiNNakerManchester/number_of_boards
Browse files Browse the repository at this point in the history
remove number_of_boards param
  • Loading branch information
rowleya authored Oct 10, 2023
2 parents 211758a + 4abf6b1 commit 28dc30d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
8 changes: 2 additions & 6 deletions spinnman/extended/extended_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@


def create_transceiver_from_hostname(
hostname, version, bmp_connection_data=None, number_of_boards=None,
auto_detect_bmp=False):
hostname, version, bmp_connection_data=None, auto_detect_bmp=False):
"""
Create a Transceiver by creating a :py:class:`~.UDPConnection` to the
given hostname on port 17893 (the default SCAMP port), and a
Expand All @@ -63,9 +62,6 @@ def create_transceiver_from_hostname(
:param hostname: The hostname or IP address of the board or `None` if
only the BMP connections are of interest
:type hostname: str or None
:param number_of_boards: a number of boards expected to be supported, or
``None``, which defaults to a single board
:type number_of_boards: int or None
:param int version: the type of SpiNNaker board used within the SpiNNaker
machine being used. If a Spinn-5 board, then the version will be 5,
Spinn-3 would equal 3 and so on.
Expand Down Expand Up @@ -97,7 +93,7 @@ def create_transceiver_from_hostname(
if (version >= 4 and auto_detect_bmp is True and
(bmp_connection_data is None or not bmp_connection_data)):
bmp_connection_data = [
work_out_bmp_from_machine_details(hostname, number_of_boards)]
work_out_bmp_from_machine_details(hostname)]

# handle BMP connections
if bmp_connection_data is not None:
Expand Down
9 changes: 3 additions & 6 deletions spinnman/transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@


def create_transceiver_from_hostname(
hostname, version, bmp_connection_data=None, number_of_boards=None,
auto_detect_bmp=False, power_cycle=False):
hostname, version, bmp_connection_data=None, auto_detect_bmp=False,
power_cycle=False):
"""
Create a Transceiver by creating a :py:class:`~.UDPConnection` to the
given hostname on port 17893 (the default SCAMP port), and a
Expand All @@ -119,9 +119,6 @@ def create_transceiver_from_hostname(
:param hostname: The hostname or IP address of the board or `None` if
only the BMP connections are of interest
:type hostname: str or None
:param number_of_boards: a number of boards expected to be supported, or
``None``, which defaults to a single board
:type number_of_boards: int or None
:param int version: the type of SpiNNaker board used within the SpiNNaker
machine being used. If a Spinn-5 board, then the version will be 5,
Spinn-3 would equal 3 and so on.
Expand Down Expand Up @@ -154,7 +151,7 @@ def create_transceiver_from_hostname(
if (version >= 4 and auto_detect_bmp is True and
(bmp_connection_data is None or not bmp_connection_data)):
bmp_connection_data = [
work_out_bmp_from_machine_details(hostname, number_of_boards)]
work_out_bmp_from_machine_details(hostname)]

# handle BMP connections
if bmp_connection_data is not None:
Expand Down
8 changes: 2 additions & 6 deletions spinnman/utilities/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
from spinnman.exceptions import SpinnmanTimeoutException


def work_out_bmp_from_machine_details(hostname, number_of_boards):
def work_out_bmp_from_machine_details(hostname):
"""
Work out the BMP connection IP address given the machine details.
This is assumed to be the IP address of the machine, with 1 subtracted
from the final part e.g. if the machine IP address is 192.168.0.5, the
BMP IP address is assumed to be 192.168.0.4
:param str hostname: the SpiNNaker machine main hostname or IP address
:param int number_of_boards: the number of boards in the machine
:return: The BMP connection data
:rtype: BMPConnectionData
"""
Expand All @@ -44,10 +43,7 @@ def work_out_bmp_from_machine_details(hostname, number_of_boards):
# add board scope for each split
# if None, the end user didn't enter anything, so assume one board
# starting at position 0
if number_of_boards == 0 or number_of_boards is None:
board_range = [0]
else:
board_range = range(number_of_boards)
board_range = [0]

# Assume a single board with no cabinet or frame specified
return BMPConnectionData(ip_address=bmp_ip_address,
Expand Down

0 comments on commit 28dc30d

Please sign in to comment.