Loading src/forecaster/tests/Tools.py +9 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ def read_csv(csv_file : str) -> pandas.DataFrame: return df def compose_descriptors(df : pandas.DataFrame) -> Dict: def compose_descriptors(df : pandas.DataFrame, num_client_endpoints : int = 0) -> Dict: devices = dict() links = dict() Loading @@ -72,11 +72,17 @@ def compose_descriptors(df : pandas.DataFrame) -> Dict: dst_port_uuid = row.source if src_device_uuid not in devices: devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': set()} endpoints = set() for num_client_endpoint in range(num_client_endpoints): endpoints.add('client:{:d}'.format(num_client_endpoint)) devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': endpoints} devices[src_device_uuid]['endpoints'].add(src_port_uuid) if dst_device_uuid not in devices: devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': set()} endpoints = set() for num_client_endpoint in range(num_client_endpoints): endpoints.add('client:{:d}'.format(num_client_endpoint)) devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': endpoints} devices[dst_device_uuid]['endpoints'].add(dst_port_uuid) if link_uuid not in links: Loading Loading
src/forecaster/tests/Tools.py +9 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ def read_csv(csv_file : str) -> pandas.DataFrame: return df def compose_descriptors(df : pandas.DataFrame) -> Dict: def compose_descriptors(df : pandas.DataFrame, num_client_endpoints : int = 0) -> Dict: devices = dict() links = dict() Loading @@ -72,11 +72,17 @@ def compose_descriptors(df : pandas.DataFrame) -> Dict: dst_port_uuid = row.source if src_device_uuid not in devices: devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': set()} endpoints = set() for num_client_endpoint in range(num_client_endpoints): endpoints.add('client:{:d}'.format(num_client_endpoint)) devices[src_device_uuid] = {'id': src_device_uuid, 'endpoints': endpoints} devices[src_device_uuid]['endpoints'].add(src_port_uuid) if dst_device_uuid not in devices: devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': set()} endpoints = set() for num_client_endpoint in range(num_client_endpoints): endpoints.add('client:{:d}'.format(num_client_endpoint)) devices[dst_device_uuid] = {'id': dst_device_uuid, 'endpoints': endpoints} devices[dst_device_uuid]['endpoints'].add(dst_port_uuid) if link_uuid not in links: Loading