Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 10, 2023
2 parents 5a4dec9 + 28dc30d commit 8a5f0ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
6 changes: 1 addition & 5 deletions spinnman/extended/extended_transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
def create_transceiver_from_hostname(
hostname: Optional[str], version: int, *,
bmp_connection_data: Optional[List[BMPConnectionData]] = None,
number_of_boards: Optional[int] = None,
auto_detect_bmp: bool = False) -> 'ExtendedTransceiver':
"""
Create a Transceiver by creating a :py:class:`~.UDPConnection` to the
Expand All @@ -70,9 +69,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 @@ -108,7 +104,7 @@ def create_transceiver_from_hostname(
assert number_of_boards is not None, \
"number_of_boards must be supplied to work out BMP connections"
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: 1 addition & 8 deletions spinnman/transceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
def create_transceiver_from_hostname(
hostname: Optional[str], version: int, *,
bmp_connection_data: Optional[BMPConnectionData] = None,
number_of_boards: Optional[int] = None,
auto_detect_bmp: bool = False,
power_cycle: bool =False) -> 'Transceiver':
"""
Expand All @@ -147,9 +146,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 @@ -183,11 +179,8 @@ def create_transceiver_from_hostname(
(bmp_connection_data is None or not bmp_connection_data)):
if hostname is None:
raise ValueError("hostname is required if deriving BMP details")
if number_of_boards is None or number_of_boards < 1:
raise ValueError(
"number_of_boards is required if deriving BMP details")
bmp_connection_data = work_out_bmp_from_machine_details(
hostname, number_of_boards)
hostname)

# handle BMP connections
if bmp_connection_data is not None:
Expand Down
5 changes: 2 additions & 3 deletions spinnman/utilities/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@


def work_out_bmp_from_machine_details(
hostname: str, number_of_boards: int) -> BMPConnectionData:
hostname: str) -> BMPConnectionData:
"""
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 @@ -43,7 +42,7 @@ def work_out_bmp_from_machine_details(
# add board scope for each split
# if None, the end user didn't enter anything, so assume one board
# starting at position 0
board_range = range(number_of_boards) if number_of_boards else [0]
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 8a5f0ff

Please sign in to comment.