Skip to content

Commit

Permalink
ip_address has type Optional[str]
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 23, 2023
1 parent 7a2f8e6 commit 65ee771
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spinn_machine/machine_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from collections import defaultdict
import logging
from typing import Collection, Iterable, Set, Tuple
from typing import Collection, Iterable, Optional, Set, Tuple
from spinn_utilities.config_holder import get_config_bool
from spinn_utilities.log import FormatAdapter
from spinn_utilities.typing.coords import XY
Expand Down Expand Up @@ -200,14 +200,14 @@ def machine_repair(original: Machine, removed_chips: Iterable[XY] = ()):
return machine_repair(new_machine)


def __bad_message(issue: str, xp: XY, address: str) -> str:
def __bad_message(issue: str, xp: XY, address: Optional[str]) -> str:
return f"Your machine has {issue} at {xp} on board {address} " \
f"which will cause algorithms to fail. " \
f"Please report this to spinnakerusers@googlegroups.com \n\n"


def __one_link_same_board_msg(
link: int, source: Chip, target: Chip, address: str,
link: int, source: Chip, target: Chip, address: Optional[str],
source_x: int, source_y: int, target_x: int, target_y: int) -> str:
return f"Link {link} from {source} to {target} does not exist, " \
f"but the opposite does. Both chips live on the same board under " \
Expand All @@ -218,8 +218,8 @@ def __one_link_same_board_msg(

def one_link_different_boards_msg(
link: int, source: Chip, target: Chip, source_x: int, source_y: int,
source_address: str, target_x: int, target_y: int,
target_address: str) -> str:
source_address: Optional[str], target_x: int, target_y: int,
target_address: Optional[str]) -> str:
return f"Link {link} from {source} to {target} does not exist, " \
f"but the opposite does. The chips live on different boards. " \
f"chip {source.x}:{source.y} resides on board with ip address " \
Expand All @@ -230,15 +230,15 @@ def one_link_different_boards_msg(


def __link_dead_chip(link: int, source: Chip, target_x: int, target_y: int,
address: str) -> str:
address: Optional[str]) -> str:
return f"Link {link} from {source} to {target_x}:{target_y} " \
f"points to a dead chip. Chip {source.x}:" \
f"{source.y} resides on board with ip address {address}. " \
f"Please report this to spinnakerusers@googlegroups.com \n\n"


def __chip_dead_parent_msg(
source: Chip, parent_x: int, parent_y: int, address: str) -> str:
def __chip_dead_parent_msg(source: Chip, parent_x: int, parent_y: int,
address: Optional[str]) -> str:
return f"The {source: Chip} will fail to receive signals because its " \
f"parent {parent_x}:{parent_y} in the signal tree has " \
f"disappeared from the machine since it was booted. " \
Expand Down

0 comments on commit 65ee771

Please sign in to comment.