Skip to content

Commit

Permalink
tag board_address should never be None
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Nov 11, 2024
1 parent 79281f4 commit b0c08cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pacman/model/tags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def add_ip_tag(self, ip_tag: IPTag, vertex: MachineVertex):
"ip_tag", str(ip_tag), "Only add IP tags with this method.")
existing_tag = None
board_address = ip_tag.board_address
assert board_address is not None
if (board_address, ip_tag.tag) in self._ip_tags:
existing_tag = self._ip_tags[board_address, ip_tag.tag]
if (existing_tag.ip_address != ip_tag.ip_address or
Expand Down Expand Up @@ -136,7 +135,6 @@ def add_reverse_ip_tag(
"The port has already been assigned on the given board")

board_address = reverse_ip_tag.board_address
assert board_address is not None
self._reverse_ip_tags[
(board_address, reverse_ip_tag.tag)] = reverse_ip_tag
self._reverse_ip_tags_by_vertex[vertex].append(reverse_ip_tag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ def __find_free_tag(
def __create_tag(
eth_chip: Chip, placement: Placement, iptag: IPtagResource,
tag: int) -> IPTag:
ethernet_ip = eth_chip.ip_address
assert ethernet_ip is not None
tag_ip = iptag.ip_address
assert tag_ip is not None
return IPTag(
eth_chip.ip_address, placement.x, placement.y,
ethernet_ip, placement.x, placement.y,
tag, tag_ip, iptag.port,
iptag.strip_sdp, iptag.traffic_identifier)

Expand All @@ -137,8 +139,10 @@ def __create_reverse_tag(
eth_chip: Chip, placement: Placement,
reverse_iptag: ReverseIPtagResource, tag: int,
port: int) -> ReverseIPTag:
ethernet_ip_address = eth_chip.ip_address
assert ethernet_ip_address is not None
return ReverseIPTag(
eth_chip.ip_address, tag, port, placement.x, placement.y, placement.p,
ethernet_ip_address, tag, port, placement.x, placement.y, placement.p,
reverse_iptag.sdp_port)


Expand Down

0 comments on commit b0c08cc

Please sign in to comment.