Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag board_address and port are never None #1240

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tag board_address and port are never None
Christian-B committed Nov 13, 2024
commit a4e4fdfaa22334bc493e6a5274748cfee5a0e05a
Original file line number Diff line number Diff line change
@@ -131,7 +131,8 @@ def test_database_interface():

_make_m_vertices(app_vertex_1, 10, 10)
_make_m_vertices(app_vertex_2, 20, 20)
params = LivePacketGatherParameters(label="LiveSpikeReceiver")
params = LivePacketGatherParameters(
label="LiveSpikeReceiver", port=10000, hostname="localhost")
lpg_vertex = LivePacketGather(params, label="LiveSpikeReceiver")
writer.add_vertex(lpg_vertex)
writer.add_edge(ApplicationEdge(app_vertex_1, lpg_vertex), "Test")
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@ def test_that_3_lpgs_are_generated_on_3_board_app_graph(self):
'payload_prefix': None,
'payload_right_shift': 0,
'number_of_packets_sent_per_time_step': 0,
'hostname': None,
'port': None,
'hostname': 'localhost',
'port': 1000,
'strip_sdp': None,
'tag': None,
'label': "Test"}
Original file line number Diff line number Diff line change
@@ -36,8 +36,7 @@ class LivePacketGatherParameters(object):
"_received_key_mask", "_translate_keys", "_translated_key_right_shift")

def __init__(
self, port: Optional[int] = None, hostname: Optional[str] = None,
tag=None, strip_sdp=True,
self, port: int, hostname: str, tag=None, strip_sdp=True,
use_prefix=False, key_prefix=None, prefix_type=None,
message_type=EIEIOType.KEY_32_BIT, right_shift=0,
payload_as_time_stamps=True, use_payload_prefix=True,
@@ -89,7 +88,7 @@ def __init__(
self._translated_key_right_shift = translated_key_right_shift

@property
def port(self) -> Optional[int]:
def port(self) -> int:
"""
Where to send data from SpiNNaker:
the port of the listening UDP socket.
@@ -99,7 +98,7 @@ def port(self) -> Optional[int]:
return self._port

@property
def hostname(self) -> Optional[str]:
def hostname(self) -> str:
"""
Where to send data from SpiNNaker: the host name of the listening UDP
socket.
4 changes: 2 additions & 2 deletions unittests/data/test_simulator_data.py
Original file line number Diff line number Diff line change
@@ -454,8 +454,8 @@ def test_live_packet_recorder_params(self):
self.assertFalse(FecDataView.has_live_packet_recorder_params())
with self.assertRaises(DataNotYetAvialable):
FecDataView.get_live_packet_recorder_params()
lpg1 = LivePacketGatherParameters(1)
lpg2 = LivePacketGatherParameters(2)
lpg1 = LivePacketGatherParameters(1, hostname="localhost")
lpg2 = LivePacketGatherParameters(2, hostname="localhost")
vertex1 = SimpleTestVertex(1, "1")
vertex2 = SimpleTestVertex(2, "2")
vertex3 = SimpleTestVertex(3, "3")