From 7351ccd48c7f71b0c621c29185b409d551901ebf Mon Sep 17 00:00:00 2001 From: armingol Date: Wed, 1 Jul 2026 06:54:53 +0000 Subject: [PATCH 1/2] feat: enable path recomputation, update deployment defaults, and remove unused L3VPN templates --- .../frontend/service/OpticalPathComp.py | 433 ++++++++++-------- .../service/PathCompServiceServicerImpl.py | 15 +- 2 files changed, 258 insertions(+), 190 deletions(-) diff --git a/src/pathcomp/frontend/service/OpticalPathComp.py b/src/pathcomp/frontend/service/OpticalPathComp.py index 20d4dc5eb..455715886 100644 --- a/src/pathcomp/frontend/service/OpticalPathComp.py +++ b/src/pathcomp/frontend/service/OpticalPathComp.py @@ -60,6 +60,12 @@ def group_block(group, action, group_id_override=None, node=None): } def compute_optical_path(service: Service) -> PathCompReply: + return _optical_path_computation(service, is_recompute=False) + +def recompute_optical_path(service: Service) -> PathCompReply: + return _optical_path_computation(service, is_recompute=True) + +def _optical_path_computation(service: Service, is_recompute: bool = False) -> PathCompReply: # Extract intent from config rules intent_str = "" for cr in service.service_config.config_rules: @@ -112,197 +118,242 @@ def compute_optical_path(service: Service) -> PathCompReply: "band": 200, "subcarriers_per_source": [4] * len(destinations_list) } + LOGGER.info(f"Optical Path Computation Payload: {payload}") - url = "http://10.30.7.66:31060/OpticalTFS/restconf/operations/tapi-path-computation:compute-p2mp" + if is_recompute: + url = "http://10.30.7.65:31060/OpticalTFS/restconf/operations/tapi-path-computation:recompute-p2mp" + else: + url = "http://10.30.7.65:31060/OpticalTFS/restconf/operations/tapi-path-computation:compute-p2mp" headers = { "Content-Type": "application/json", "Accept": "*/*" } - # resp = requests.post(url, headers=headers, json=payload, timeout=15) - # resp.raise_for_status() - # resp_json = resp.json() + resp = requests.post(url, headers=headers, json=payload, timeout=15) + resp.raise_for_status() + resp_json = resp.json() + LOGGER.info(f"Optical Path Computation Response: {resp_json}") # MOCK RESPONSE (If the Optical Controller is down) - resp_json = { - "tapi-connectivity:connectivity-service": { - "connection": [ - { - "optical-connection-attributes": { - "central-frequency": 195000000000000, - "Tx-power": 0, - "modulation": { - "modulation-technique": "DP-16QAM", - "operational-mode": 9, - "port": "port-1" - }, - "digital-subcarrier-spacing": 300000000, - "subcarrier-attributes": { - "digital-subcarrier-group": [ - { - "group-id": 1, - "modulation-technique": "DP-QPSK", - "central-frequency": 195006250, - "operational-mode": 4, - "Tx-power": -99, - "group-size": 4, - "port": "port-1", - "subcarrier-id": [1, 2, 3, 4] - }, - { - "group-id": 2, - "modulation-technique": "DP-QPSK", - "central-frequency": 195018750, - "operational-mode": 4, - "Tx-power": -99, - "group-size": 4, - "port": "port-3", - "subcarrier-id": [5, 6, 7, 8] - }, - { - "group-id": 3, - "modulation-technique": "DP-QPSK", - "central-frequency": 195031250, - "operational-mode": 4, - "Tx-power": -99, - "group-size": 4, - "port": "port-5", - "subcarrier-id": [9, 10, 11, 12] - } - ] - } - }, - "end-point": [ - { - "direction": "BIDIRECTIONAL", - "layer-protocol-name": "PHOTONIC_MEDIA", - "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - "local-id": "T1.1", - "service-interface-point": { - "service-interface-point-uuid": "T2.1" - }, - "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - "mc-config": { - "spectrum": { - "center-frequency": 195000000000000, - "frequency-constraint": { - "adjustment-granularity": "G_6_25GHZ", - "grid-type": "FLEX" - } - } - } - } - }, - { - "direction": "BIDIRECTIONAL", - "layer-protocol-name": "PHOTONIC_MEDIA", - "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - "local-id": "T2.1", - "service-interface-point": { - "service-interface-point-uuid": "T1.1" - }, - "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - "mc-config": { - "spectrum": { - "center-frequency": 195006250, - "frequency-constraint": { - "adjustment-granularity": "G_6_25GHZ", - "grid-type": "FLEX" - } - } - } - } - }, - { - "direction": "BIDIRECTIONAL", - "layer-protocol-name": "PHOTONIC_MEDIA", - "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - "local-id": "T1.2", - "service-interface-point": { - "service-interface-point-uuid": "T2.1" - }, - "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - "mc-config": { - "spectrum": { - "center-frequency": 195018750, - "frequency-constraint": { - "adjustment-granularity": "G_6_25GHZ", - "grid-type": "FLEX" - } - } - } - } - }, - { - "direction": "BIDIRECTIONAL", - "layer-protocol-name": "PHOTONIC_MEDIA", - "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - "local-id": "T2.1", - "service-interface-point": { - "service-interface-point-uuid": "T1.2" - }, - "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - "mc-config": { - "spectrum": { - "center-frequency": 195018750, - "frequency-constraint": { - "adjustment-granularity": "G_6_25GHZ", - "grid-type": "FLEX" - } - } - } - } - }, - { - "direction": "BIDIRECTIONAL", - "layer-protocol-name": "PHOTONIC_MEDIA", - "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - "local-id": "T1.3", - "service-interface-point": { - "service-interface-point-uuid": "T2.1" - }, - "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - "mc-config": { - "spectrum": { - "center-frequency": 195031250, - "frequency-constraint": { - "adjustment-granularity": "G_6_25GHZ", - "grid-type": "FLEX" - } - } - } - } - }, - { - "direction": "BIDIRECTIONAL", - "layer-protocol-name": "PHOTONIC_MEDIA", - "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - "local-id": "T2.1", - "service-interface-point": { - "service-interface-point-uuid": "T1.3" - }, - "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - "mc-config": { - "spectrum": { - "center-frequency": 195031250, - "frequency-constraint": { - "adjustment-granularity": "G_6_25GHZ", - "grid-type": "FLEX" - } - } - } - } - } - ] - } - ] - } - } - + # if is_recompute: + # resp_json = { + # "overridden_records": { + # "T2.1": { + # "sources": [ + # "T1.1", + # "T1.3" + # ], + # "destinations": [ + # "T2.1" + # ], + # "flow_id": 5, + # "established_via": "ComputeP2MP", + # "timestamp": "2026-06-29T14:45:33.546337+00:00", + # "bitrate": 100, + # "bidirectional": False, + # "frequency": 0, + # "band": 100, + # "subcarriers_per_source": [ + # 4, + # 4 + # ] + # } + # }, + # "tapi-connectivity:connectivity-service": { + # "connection": [ + # { + # "optical-connection-attributes": { + # "central-frequency": 195000000000000, + # "Tx-power": 0, + # "modulation": { + # "modulation-technique": "DP-16QAM", + # "operational-mode": 9, + # "port": "port-1" + # }, + # "digital-subcarrier-spacing": 300000000, + # "subcarrier-attributes": { + # "digital-subcarrier-group": [ + # { + # "group-id": 1, + # "modulation-technique": "DP-QPSK", + # "central-frequency": 195006250, + # "operational-mode": 4, + # "Tx-power": -99, + # "group-size": 4, + # "port": "port-1", + # "subcarrier-id": [1, 2, 3, 4] + # }, + # { + # "group-id": 2, + # "modulation-technique": "DP-QPSK", + # "central-frequency": 195018750, + # "operational-mode": 4, + # "Tx-power": -99, + # "group-size": 4, + # "port": "port-3", + # "subcarrier-id": [5, 6, 7, 8] + # }, + # { + # "group-id": 3, + # "modulation-technique": "DP-QPSK", + # "central-frequency": 195031250, + # "operational-mode": 4, + # "Tx-power": -99, + # "group-size": 4, + # "port": "port-5", + # "subcarrier-id": [9, 10, 11, 12] + # } + # ] + # } + # }, + # "end-point": [ + # { + # "direction": "BIDIRECTIONAL", + # "layer-protocol-name": "PHOTONIC_MEDIA", + # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", + # "local-id": "T1.3", + # "service-interface-point": { + # "service-interface-point-uuid": "T2.1" + # }, + # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { + # "mc-config": { + # "spectrum": { + # "center-frequency": 195000000000000, + # "frequency-constraint": { + # "adjustment-granularity": "G_6_25GHZ", + # "grid-type": "FLEX" + # } + # } + # } + # } + # }, + # { + # "direction": "BIDIRECTIONAL", + # "layer-protocol-name": "PHOTONIC_MEDIA", + # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", + # "local-id": "T2.1", + # "service-interface-point": { + # "service-interface-point-uuid": "T1.1" + # }, + # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { + # "mc-config": { + # "spectrum": { + # "center-frequency": 195036250, + # "frequency-constraint": { + # "adjustment-granularity": "G_6_25GHZ", + # "grid-type": "FLEX" + # } + # } + # } + # } + # } + # ] + # } + # ] + # } + # } + # else: + # resp_json = { + # "tapi-connectivity:connectivity-service": { + # "connection": [ + # { + # "optical-connection-attributes": { + # "central-frequency": 195000000000000, + # "Tx-power": 0, + # "modulation": { + # "modulation-technique": "DP-16QAM", + # "operational-mode": 9, + # "port": "port-1" + # }, + # "digital-subcarrier-spacing": 300000000, + # "subcarrier-attributes": { + # "digital-subcarrier-group": [ + # { + # "group-id": 1, + # "modulation-technique": "DP-QPSK", + # "central-frequency": 195006250, + # "operational-mode": 4, + # "Tx-power": -99, + # "group-size": 4, + # "port": "port-1", + # "subcarrier-id": [1, 2, 3, 4] + # }, + # { + # "group-id": 2, + # "modulation-technique": "DP-QPSK", + # "central-frequency": 195018750, + # "operational-mode": 4, + # "Tx-power": -99, + # "group-size": 4, + # "port": "port-3", + # "subcarrier-id": [5, 6, 7, 8] + # }, + # { + # "group-id": 3, + # "modulation-technique": "DP-QPSK", + # "central-frequency": 195031250, + # "operational-mode": 4, + # "Tx-power": -99, + # "group-size": 4, + # "port": "port-5", + # "subcarrier-id": [9, 10, 11, 12] + # } + # ] + # } + # }, + # "end-point": [ + # { + # "direction": "BIDIRECTIONAL", + # "layer-protocol-name": "PHOTONIC_MEDIA", + # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", + # "local-id": "T1.1", + # "service-interface-point": { + # "service-interface-point-uuid": "T2.1" + # }, + # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { + # "mc-config": { + # "spectrum": { + # "center-frequency": 195000000000000, + # "frequency-constraint": { + # "adjustment-granularity": "G_6_25GHZ", + # "grid-type": "FLEX" + # } + # } + # } + # } + # }, + # { + # "direction": "BIDIRECTIONAL", + # "layer-protocol-name": "PHOTONIC_MEDIA", + # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", + # "local-id": "T2.1", + # "service-interface-point": { + # "service-interface-point-uuid": "T1.1" + # }, + # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { + # "mc-config": { + # "spectrum": { + # "center-frequency": 195006250, + # "frequency-constraint": { + # "adjustment-granularity": "G_6_25GHZ", + # "grid-type": "FLEX" + # } + # } + # } + # } + # } + # ] + # } + # ] + # } + # } + + # Generate Rules src_name = source # T2.1 dest_list = destinations_list # T1.1, T1.2 # Extract destinations from response end-points if available + endpoints = [] try: endpoints = resp_json.get("tapi-connectivity:connectivity-service", {}).get("connection", [{}])[0].get("end-point", []) extracted_dests = [] @@ -310,7 +361,7 @@ def compute_optical_path(service: Service) -> PathCompReply: local_id = ep.get("local-id") if local_id and local_id != src_name and local_id not in extracted_dests: extracted_dests.append(local_id) - if extracted_dests: + if extracted_dests and any(d in nodes for d in extracted_dests): dest_list = extracted_dests except Exception: pass @@ -343,8 +394,9 @@ def compute_optical_path(service: Service) -> PathCompReply: hub_freq_raw = attributes.get("central-frequency", 195000000000000) hub_freq = int(hub_freq_raw / 1e6) if hub_freq_raw > 1e10 else int(hub_freq_raw) + hub_name = endpoints[0].get("local-id") if len(endpoints) > 0 else "channel-1" hub = { - "name": "channel-1", + "name": hub_name, "frequency": hub_freq, "target_output_power": attributes.get("Tx-power", 0), "operational_mode": operational_mode, @@ -355,15 +407,22 @@ def compute_optical_path(service: Service) -> PathCompReply: leaves = [] print("dest_list:", dest_list) print("groups:", groups) - for dest, group in zip(dest_list, groups): - port = group.get("port", "port-1") - if port.startswith("port-"): - name = f"channel-{port.split('-')[1]}" + for index, (dest, group) in enumerate(zip(dest_list, groups)): + if len(endpoints) > index + 1: + name = endpoints[index + 1].get("local-id") else: - name = "channel-1" + port = group.get("port", "port-1") + if port.startswith("port-"): + name = f"channel-{port.split('-')[1]}" + else: + name = "channel-1" freq_raw = group.get("central-frequency", 195006250) - freq = int(freq_raw / 1e6) if freq_raw > 1e10 else int(freq_raw) + freq_val = int(freq_raw / 1e6) if freq_raw > 1e10 else int(freq_raw) + # if freq_val == hub_freq: + # freq = hub_freq + 6250 + index * 12500 + # else: + freq = freq_val leaf = { "name": name, diff --git a/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py b/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py index d7e3f2daf..652fd53d7 100644 --- a/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py +++ b/src/pathcomp/frontend/service/PathCompServiceServicerImpl.py @@ -28,7 +28,7 @@ from pathcomp.frontend.Config import is_forecaster_enabled #from context.client.ContextClient import ContextClient from pathcomp.frontend.service.TopologyTools import get_pathcomp_topology_details from pathcomp.frontend.service.algorithms.Factory import get_algorithm -from pathcomp.frontend.service.OpticalPathComp import compute_optical_path +from pathcomp.frontend.service.OpticalPathComp import compute_optical_path, recompute_optical_path from common.proto.context_pb2 import ServiceTypeEnum LOGGER = logging.getLogger(__name__) @@ -48,8 +48,17 @@ class PathCompServiceServicerImpl(PathCompServiceServicer): LOGGER.debug('[Compute] begin ; request = {:s}'.format(grpc_message_to_json_string(request))) if len(request.services) > 0 and request.services[0].service_type == ServiceTypeEnum.SERVICETYPE_OPTICAL_CONNECTIVITY: - LOGGER.info('[Compute] Intercepting OPTICAL_CONNECTIVITY request...') - return compute_optical_path(request.services[0]) + is_recompute = False + for cr in request.services[0].service_config.config_rules: + if cr.WhichOneof('config_rule') == 'custom' and cr.custom.resource_key == "recompute" and cr.custom.resource_value == "true": + is_recompute = True + break + if is_recompute: + LOGGER.info('[Compute] Intercepting OPTICAL_CONNECTIVITY recomputation request...') + return recompute_optical_path(request.services[0]) + else: + LOGGER.info('[Compute] Intercepting OPTICAL_CONNECTIVITY request...') + return compute_optical_path(request.services[0]) #context_client = ContextClient() -- GitLab From 637dcb63373b9c2100ad8aa40394469840160af6 Mon Sep 17 00:00:00 2001 From: armingol Date: Wed, 1 Jul 2026 14:36:45 +0000 Subject: [PATCH 2/2] Code Clean up --- .../frontend/service/OpticalPathComp.py | 223 +----------------- 1 file changed, 2 insertions(+), 221 deletions(-) diff --git a/src/pathcomp/frontend/service/OpticalPathComp.py b/src/pathcomp/frontend/service/OpticalPathComp.py index 455715886..c83a55051 100644 --- a/src/pathcomp/frontend/service/OpticalPathComp.py +++ b/src/pathcomp/frontend/service/OpticalPathComp.py @@ -132,222 +132,7 @@ def _optical_path_computation(service: Service, is_recompute: bool = False) -> P resp = requests.post(url, headers=headers, json=payload, timeout=15) resp.raise_for_status() resp_json = resp.json() - LOGGER.info(f"Optical Path Computation Response: {resp_json}") - - # MOCK RESPONSE (If the Optical Controller is down) - # if is_recompute: - # resp_json = { - # "overridden_records": { - # "T2.1": { - # "sources": [ - # "T1.1", - # "T1.3" - # ], - # "destinations": [ - # "T2.1" - # ], - # "flow_id": 5, - # "established_via": "ComputeP2MP", - # "timestamp": "2026-06-29T14:45:33.546337+00:00", - # "bitrate": 100, - # "bidirectional": False, - # "frequency": 0, - # "band": 100, - # "subcarriers_per_source": [ - # 4, - # 4 - # ] - # } - # }, - # "tapi-connectivity:connectivity-service": { - # "connection": [ - # { - # "optical-connection-attributes": { - # "central-frequency": 195000000000000, - # "Tx-power": 0, - # "modulation": { - # "modulation-technique": "DP-16QAM", - # "operational-mode": 9, - # "port": "port-1" - # }, - # "digital-subcarrier-spacing": 300000000, - # "subcarrier-attributes": { - # "digital-subcarrier-group": [ - # { - # "group-id": 1, - # "modulation-technique": "DP-QPSK", - # "central-frequency": 195006250, - # "operational-mode": 4, - # "Tx-power": -99, - # "group-size": 4, - # "port": "port-1", - # "subcarrier-id": [1, 2, 3, 4] - # }, - # { - # "group-id": 2, - # "modulation-technique": "DP-QPSK", - # "central-frequency": 195018750, - # "operational-mode": 4, - # "Tx-power": -99, - # "group-size": 4, - # "port": "port-3", - # "subcarrier-id": [5, 6, 7, 8] - # }, - # { - # "group-id": 3, - # "modulation-technique": "DP-QPSK", - # "central-frequency": 195031250, - # "operational-mode": 4, - # "Tx-power": -99, - # "group-size": 4, - # "port": "port-5", - # "subcarrier-id": [9, 10, 11, 12] - # } - # ] - # } - # }, - # "end-point": [ - # { - # "direction": "BIDIRECTIONAL", - # "layer-protocol-name": "PHOTONIC_MEDIA", - # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - # "local-id": "T1.3", - # "service-interface-point": { - # "service-interface-point-uuid": "T2.1" - # }, - # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - # "mc-config": { - # "spectrum": { - # "center-frequency": 195000000000000, - # "frequency-constraint": { - # "adjustment-granularity": "G_6_25GHZ", - # "grid-type": "FLEX" - # } - # } - # } - # } - # }, - # { - # "direction": "BIDIRECTIONAL", - # "layer-protocol-name": "PHOTONIC_MEDIA", - # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - # "local-id": "T2.1", - # "service-interface-point": { - # "service-interface-point-uuid": "T1.1" - # }, - # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - # "mc-config": { - # "spectrum": { - # "center-frequency": 195036250, - # "frequency-constraint": { - # "adjustment-granularity": "G_6_25GHZ", - # "grid-type": "FLEX" - # } - # } - # } - # } - # } - # ] - # } - # ] - # } - # } - # else: - # resp_json = { - # "tapi-connectivity:connectivity-service": { - # "connection": [ - # { - # "optical-connection-attributes": { - # "central-frequency": 195000000000000, - # "Tx-power": 0, - # "modulation": { - # "modulation-technique": "DP-16QAM", - # "operational-mode": 9, - # "port": "port-1" - # }, - # "digital-subcarrier-spacing": 300000000, - # "subcarrier-attributes": { - # "digital-subcarrier-group": [ - # { - # "group-id": 1, - # "modulation-technique": "DP-QPSK", - # "central-frequency": 195006250, - # "operational-mode": 4, - # "Tx-power": -99, - # "group-size": 4, - # "port": "port-1", - # "subcarrier-id": [1, 2, 3, 4] - # }, - # { - # "group-id": 2, - # "modulation-technique": "DP-QPSK", - # "central-frequency": 195018750, - # "operational-mode": 4, - # "Tx-power": -99, - # "group-size": 4, - # "port": "port-3", - # "subcarrier-id": [5, 6, 7, 8] - # }, - # { - # "group-id": 3, - # "modulation-technique": "DP-QPSK", - # "central-frequency": 195031250, - # "operational-mode": 4, - # "Tx-power": -99, - # "group-size": 4, - # "port": "port-5", - # "subcarrier-id": [9, 10, 11, 12] - # } - # ] - # } - # }, - # "end-point": [ - # { - # "direction": "BIDIRECTIONAL", - # "layer-protocol-name": "PHOTONIC_MEDIA", - # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - # "local-id": "T1.1", - # "service-interface-point": { - # "service-interface-point-uuid": "T2.1" - # }, - # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - # "mc-config": { - # "spectrum": { - # "center-frequency": 195000000000000, - # "frequency-constraint": { - # "adjustment-granularity": "G_6_25GHZ", - # "grid-type": "FLEX" - # } - # } - # } - # } - # }, - # { - # "direction": "BIDIRECTIONAL", - # "layer-protocol-name": "PHOTONIC_MEDIA", - # "layer-protocol-qualifier": "tapi-photonic-media:PHOTONIC_LAYER_QUALIFIER_MC", - # "local-id": "T2.1", - # "service-interface-point": { - # "service-interface-point-uuid": "T1.1" - # }, - # "tapi-photonic-media:media-channel-connectivity-service-end-point-spec": { - # "mc-config": { - # "spectrum": { - # "center-frequency": 195006250, - # "frequency-constraint": { - # "adjustment-granularity": "G_6_25GHZ", - # "grid-type": "FLEX" - # } - # } - # } - # } - # } - # ] - # } - # ] - # } - # } - + LOGGER.info(f"Optical Path Computation Response: {resp_json}") # Generate Rules src_name = source # T2.1 @@ -418,11 +203,7 @@ def _optical_path_computation(service: Service, is_recompute: bool = False) -> P name = "channel-1" freq_raw = group.get("central-frequency", 195006250) - freq_val = int(freq_raw / 1e6) if freq_raw > 1e10 else int(freq_raw) - # if freq_val == hub_freq: - # freq = hub_freq + 6250 + index * 12500 - # else: - freq = freq_val + freq = int(freq_raw / 1e6) if freq_raw > 1e10 else int(freq_raw) leaf = { "name": name, -- GitLab