From b93c6dbcbd27c97e8cd7022c64d28f0705545d51 Mon Sep 17 00:00:00 2001 From: EstherLerouzic Date: Wed, 13 Jun 2018 16:42:10 +0100 Subject: [PATCH] Merge: merge completed Path_requests_run and convert_service_sheet.py now use funtions from transmission main ISSUE from develop refactor : the json generation of the topology is missing all amplifiers ! - ILA are not included - some edfa appear in the json topo when Eqpt sheet is used, but not all of them (only for the requested path when running transmission_main_example) TODO : identify if this is a new behaviour or if this is a regression Signed-off-by: EstherLerouzic --- examples/convert.py | 2 +- examples/convert_service_sheet.py | 6 +- examples/meshTopologyExampleV2.json | 527 ++++++++++---------------- examples/meshTopologyExampleV2.xls | Bin 13824 -> 14336 bytes examples/path_requests_run.py | 62 +-- examples/transmission_main_example.py | 10 +- 6 files changed, 249 insertions(+), 358 deletions(-) diff --git a/examples/convert.py b/examples/convert.py index d8ee6b3d..e93bd0df 100755 --- a/examples/convert.py +++ b/examples/convert.py @@ -167,7 +167,7 @@ def convert_file(input_filename, filter_region=[]): 'params': {'length': round(x.west_distance, 3), 'length_units': x.distance_units, 'loss_coef': x.west_lineic} - } + } # missing ILA construction for x in links] + [{'uid': f'egress edfa in {e.from_city} to {e.to_city}', 'metadata': {'location': {'city': nodes_by_city[e.from_city].city, diff --git a/examples/convert_service_sheet.py b/examples/convert_service_sheet.py index e28e39c6..95a6f1a1 100644 --- a/examples/convert_service_sheet.py +++ b/examples/convert_service_sheet.py @@ -24,7 +24,7 @@ from collections import namedtuple from logging import getLogger, basicConfig, CRITICAL, DEBUG, INFO from json import dumps from pathlib import Path -from gnpy.core.equipment import get_eqpt_params, eqpt_exists, read_eqpt_library +from examples.transmission_main_example import load_equipment from gnpy.core.utils import db2lin, lin2db SERVICES_COLUMN = 11 @@ -60,8 +60,8 @@ class Request_element(Element): self.dsttpid = f'trx {Request.destination}' # test that trx_type belongs to eqpt_config.json # if not replace it with a default - read_eqpt_library(eqpt_filename) - if eqpt_exists(Request.trx_type): + equipment = load_equipment(eqpt_filename) + if equipment['Transceiver'][Request.trx_type]: self.trx_type = Request.trx_type self.mode = Request.mode else: diff --git a/examples/meshTopologyExampleV2.json b/examples/meshTopologyExampleV2.json index ff037c7e..d97897e2 100644 --- a/examples/meshTopologyExampleV2.json +++ b/examples/meshTopologyExampleV2.json @@ -6,8 +6,8 @@ "location": { "city": "Lannion_CAS", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 0.0 } }, "type": "Transceiver" @@ -18,8 +18,8 @@ "location": { "city": "Lorient_KMA", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 3.0 } }, "type": "Transceiver" @@ -30,8 +30,8 @@ "location": { "city": "Vannes_KBE", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 4.0 } }, "type": "Transceiver" @@ -42,8 +42,8 @@ "location": { "city": "Rennes_STA", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 0.0, + "longitude": 0.0 } }, "type": "Transceiver" @@ -54,8 +54,32 @@ "location": { "city": "Brest_KLA", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 4.0, + "longitude": 0.0 + } + }, + "type": "Transceiver" + }, + { + "uid": "trx toto", + "metadata": { + "location": { + "city": "toto", + "region": "", + "latitude": 6.0, + "longitude": 0.0 + } + }, + "type": "Transceiver" + }, + { + "uid": "trx tata", + "metadata": { + "location": { + "city": "tata", + "region": "", + "latitude": 7.0, + "longitude": 0.0 } }, "type": "Transceiver" @@ -66,8 +90,8 @@ "location": { "city": "Lannion_CAS", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 0.0 } }, "type": "Roadm" @@ -78,8 +102,8 @@ "location": { "city": "Lorient_KMA", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 3.0 } }, "type": "Roadm" @@ -90,8 +114,8 @@ "location": { "city": "Vannes_KBE", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 4.0 } }, "type": "Roadm" @@ -102,8 +126,8 @@ "location": { "city": "Rennes_STA", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 0.0, + "longitude": 0.0 } }, "type": "Roadm" @@ -114,8 +138,32 @@ "location": { "city": "Brest_KLA", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 4.0, + "longitude": 0.0 + } + }, + "type": "Roadm" + }, + { + "uid": "roadm toto", + "metadata": { + "location": { + "city": "toto", + "region": "", + "latitude": 6.0, + "longitude": 0.0 + } + }, + "type": "Roadm" + }, + { + "uid": "roadm tata", + "metadata": { + "location": { + "city": "tata", + "region": "", + "latitude": 7.0, + "longitude": 0.0 } }, "type": "Roadm" @@ -126,8 +174,8 @@ "location": { "city": "Corlay", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 1.0 } }, "type": "Fused" @@ -138,8 +186,8 @@ "location": { "city": "Loudeac", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 2.0 } }, "type": "Fused" @@ -150,8 +198,8 @@ "location": { "city": "Morlaix", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 3.0, + "longitude": 0.0 } }, "type": "Fused" @@ -162,8 +210,8 @@ "location": { "city": "Corlay", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 1.0 } }, "type": "Fused" @@ -174,8 +222,8 @@ "location": { "city": "Loudeac", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 2.0, + "longitude": 2.0 } }, "type": "Fused" @@ -186,18 +234,18 @@ "location": { "city": "Morlaix", "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 3.0, + "longitude": 0.0 } }, "type": "Fused" }, { - "uid": "fiber (Lannion_CAS \u2192 Corlay)-", + "uid": "fiber (Lannion_CAS \u2192 Corlay)-F061", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 0.5 } }, "type": "Fiber", @@ -209,11 +257,11 @@ } }, { - "uid": "fiber (Corlay \u2192 Loudeac)-", + "uid": "fiber (Corlay \u2192 Loudeac)-F010", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 1.5 } }, "type": "Fiber", @@ -225,11 +273,11 @@ } }, { - "uid": "fiber (Loudeac \u2192 Lorient_KMA)-", + "uid": "fiber (Loudeac \u2192 Lorient_KMA)-F054", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 2.5 } }, "type": "Fiber", @@ -241,11 +289,11 @@ } }, { - "uid": "fiber (Lorient_KMA \u2192 Vannes_KBE)-F01", + "uid": "fiber (Lorient_KMA \u2192 Vannes_KBE)-F055", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 3.5 } }, "type": "Fiber", @@ -257,10 +305,10 @@ } }, { - "uid": "fiber (Lannion_CAS \u2192 Stbrieuc)-", + "uid": "fiber (Lannion_CAS \u2192 Stbrieuc)-F056", "metadata": { "location": { - "latitude": 0.0, + "latitude": 1.5, "longitude": 0.0 } }, @@ -273,10 +321,10 @@ } }, { - "uid": "fiber (Stbrieuc \u2192 Rennes_STA)-", + "uid": "fiber (Stbrieuc \u2192 Rennes_STA)-F057", "metadata": { "location": { - "latitude": 0.0, + "latitude": 0.5, "longitude": 0.0 } }, @@ -289,10 +337,10 @@ } }, { - "uid": "fiber (Lannion_CAS \u2192 Morlaix)-", + "uid": "fiber (Lannion_CAS \u2192 Morlaix)-F059", "metadata": { "location": { - "latitude": 0.0, + "latitude": 2.5, "longitude": 0.0 } }, @@ -305,10 +353,10 @@ } }, { - "uid": "fiber (Morlaix \u2192 Brest_KLA)-", + "uid": "fiber (Morlaix \u2192 Brest_KLA)-F060", "metadata": { "location": { - "latitude": 0.0, + "latitude": 3.5, "longitude": 0.0 } }, @@ -321,15 +369,31 @@ } }, { - "uid": "fiber (Corlay \u2192 Lannion_CAS)-", + "uid": "fiber (toto \u2192 tata)-", "metadata": { "location": { - "latitude": 0.0, + "latitude": 6.5, "longitude": 0.0 } }, "type": "Fiber", "type_variety": "SSMF", + "params": { + "length": 80.0, + "length_units": "km", + "loss_coef": 0.2 + } + }, + { + "uid": "fiber (Corlay \u2192 Lannion_CAS)-F061", + "metadata": { + "location": { + "latitude": 2.0, + "longitude": 0.5 + } + }, + "type": "Fiber", + "type_variety": "SSMF", "params": { "length": 20.0, "length_units": "km", @@ -337,11 +401,11 @@ } }, { - "uid": "fiber (Loudeac \u2192 Corlay)-", + "uid": "fiber (Loudeac \u2192 Corlay)-F010", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 1.5 } }, "type": "Fiber", @@ -353,11 +417,11 @@ } }, { - "uid": "fiber (Lorient_KMA \u2192 Loudeac)-", + "uid": "fiber (Lorient_KMA \u2192 Loudeac)-F054", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 2.5 } }, "type": "Fiber", @@ -369,11 +433,11 @@ } }, { - "uid": "fiber (Vannes_KBE \u2192 Lorient_KMA)-F01", + "uid": "fiber (Vannes_KBE \u2192 Lorient_KMA)-F055", "metadata": { "location": { - "latitude": 0.0, - "longitude": 0.0 + "latitude": 2.0, + "longitude": 3.5 } }, "type": "Fiber", @@ -385,10 +449,10 @@ } }, { - "uid": "fiber (Stbrieuc \u2192 Lannion_CAS)-", + "uid": "fiber (Stbrieuc \u2192 Lannion_CAS)-F056", "metadata": { "location": { - "latitude": 0.0, + "latitude": 1.5, "longitude": 0.0 } }, @@ -401,10 +465,10 @@ } }, { - "uid": "fiber (Rennes_STA \u2192 Stbrieuc)-", + "uid": "fiber (Rennes_STA \u2192 Stbrieuc)-F057", "metadata": { "location": { - "latitude": 0.0, + "latitude": 0.5, "longitude": 0.0 } }, @@ -417,10 +481,10 @@ } }, { - "uid": "fiber (Morlaix \u2192 Lannion_CAS)-", + "uid": "fiber (Morlaix \u2192 Lannion_CAS)-F059", "metadata": { "location": { - "latitude": 0.0, + "latitude": 2.5, "longitude": 0.0 } }, @@ -433,10 +497,10 @@ } }, { - "uid": "fiber (Brest_KLA \u2192 Morlaix)-", + "uid": "fiber (Brest_KLA \u2192 Morlaix)-F060", "metadata": { "location": { - "latitude": 0.0, + "latitude": 3.5, "longitude": 0.0 } }, @@ -449,350 +513,159 @@ } }, { - "uid": "egress edfa in Lannion_CAS to Corlay", + "uid": "fiber (tata \u2192 toto)-", "metadata": { "location": { - "city": "Lannion_CAS", - "region": "RLD", - "latitude": 0, - "longitude": 0 + "latitude": 6.5, + "longitude": 0.0 } }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Loudeac to Lorient_KMA", - "metadata": { - "location": { - "city": "Loudeac", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Lorient_KMA to Vannes_KBE", - "metadata": { - "location": { - "city": "Lorient_KMA", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Lannion_CAS to Stbrieuc", - "metadata": { - "location": { - "city": "Lannion_CAS", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Stbrieuc to Rennes_STA", - "metadata": { - "location": { - "city": "Stbrieuc", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Lannion_CAS to Morlaix", - "metadata": { - "location": { - "city": "Lannion_CAS", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Morlaix to Brest_KLA", - "metadata": { - "location": { - "city": "Morlaix", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Lorient_KMA to Loudeac", - "metadata": { - "location": { - "city": "Lorient_KMA", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Vannes_KBE to Lorient_KMA", - "metadata": { - "location": { - "city": "Vannes_KBE", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Rennes_STA to Stbrieuc", - "metadata": { - "location": { - "city": "Rennes_STA", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 - } - }, - { - "uid": "egress edfa in Brest_KLA to Morlaix", - "metadata": { - "location": { - "city": "Brest_KLA", - "region": "RLD", - "latitude": 0, - "longitude": 0 - } - }, - "type": "Edfa", - "type_variety": "test", - "operational": { - "gain_target": 0, - "tilt_target": 0 + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 80.0, + "length_units": "km", + "loss_coef": 0.2 } } ], "connections": [ { "from_node": "roadm Lannion_CAS", - "to_node": "egress edfa in Lannion_CAS to Corlay" + "to_node": "fiber (Lannion_CAS \u2192 Corlay)-F061" }, { - "from_node": "egress edfa in Lannion_CAS to Corlay", - "to_node": "fiber (Lannion_CAS \u2192 Corlay)-" - }, - { - "from_node": "fiber (Corlay \u2192 Lannion_CAS)-", + "from_node": "fiber (Corlay \u2192 Lannion_CAS)-F061", "to_node": "roadm Lannion_CAS" }, { "from_node": "roadm Lannion_CAS", - "to_node": "egress edfa in Lannion_CAS to Stbrieuc" + "to_node": "fiber (Lannion_CAS \u2192 Stbrieuc)-F056" }, { - "from_node": "egress edfa in Lannion_CAS to Stbrieuc", - "to_node": "fiber (Lannion_CAS \u2192 Stbrieuc)-" - }, - { - "from_node": "fiber (Stbrieuc \u2192 Lannion_CAS)-", + "from_node": "fiber (Stbrieuc \u2192 Lannion_CAS)-F056", "to_node": "roadm Lannion_CAS" }, { "from_node": "roadm Lannion_CAS", - "to_node": "egress edfa in Lannion_CAS to Morlaix" + "to_node": "fiber (Lannion_CAS \u2192 Morlaix)-F059" }, { - "from_node": "egress edfa in Lannion_CAS to Morlaix", - "to_node": "fiber (Lannion_CAS \u2192 Morlaix)-" - }, - { - "from_node": "fiber (Morlaix \u2192 Lannion_CAS)-", + "from_node": "fiber (Morlaix \u2192 Lannion_CAS)-F059", "to_node": "roadm Lannion_CAS" }, { - "from_node": "fiber (Lannion_CAS \u2192 Corlay)-", + "from_node": "fiber (Lannion_CAS \u2192 Corlay)-F061", "to_node": "ingress fused spans in Corlay" }, { "from_node": "ingress fused spans in Corlay", - "to_node": "fiber (Corlay \u2192 Loudeac)-" + "to_node": "fiber (Corlay \u2192 Loudeac)-F010" }, { - "from_node": "fiber (Loudeac \u2192 Corlay)-", + "from_node": "fiber (Loudeac \u2192 Corlay)-F010", "to_node": "egress fused spans in Corlay" }, { "from_node": "egress fused spans in Corlay", - "to_node": "fiber (Corlay \u2192 Lannion_CAS)-" + "to_node": "fiber (Corlay \u2192 Lannion_CAS)-F061" }, { - "from_node": "fiber (Corlay \u2192 Loudeac)-", + "from_node": "fiber (Corlay \u2192 Loudeac)-F010", "to_node": "ingress fused spans in Loudeac" }, { "from_node": "ingress fused spans in Loudeac", - "to_node": "fiber (Loudeac \u2192 Lorient_KMA)-" + "to_node": "fiber (Loudeac \u2192 Lorient_KMA)-F054" }, { - "from_node": "fiber (Lorient_KMA \u2192 Loudeac)-", + "from_node": "fiber (Lorient_KMA \u2192 Loudeac)-F054", "to_node": "egress fused spans in Loudeac" }, { "from_node": "egress fused spans in Loudeac", - "to_node": "fiber (Loudeac \u2192 Corlay)-" + "to_node": "fiber (Loudeac \u2192 Corlay)-F010" }, { "from_node": "roadm Lorient_KMA", - "to_node": "egress edfa in Lorient_KMA to Loudeac" + "to_node": "fiber (Lorient_KMA \u2192 Loudeac)-F054" }, { - "from_node": "egress edfa in Lorient_KMA to Loudeac", - "to_node": "fiber (Lorient_KMA \u2192 Loudeac)-" - }, - { - "from_node": "fiber (Loudeac \u2192 Lorient_KMA)-", + "from_node": "fiber (Loudeac \u2192 Lorient_KMA)-F054", "to_node": "roadm Lorient_KMA" }, { "from_node": "roadm Lorient_KMA", - "to_node": "egress edfa in Lorient_KMA to Vannes_KBE" + "to_node": "fiber (Lorient_KMA \u2192 Vannes_KBE)-F055" }, { - "from_node": "egress edfa in Lorient_KMA to Vannes_KBE", - "to_node": "fiber (Lorient_KMA \u2192 Vannes_KBE)-F01" - }, - { - "from_node": "fiber (Vannes_KBE \u2192 Lorient_KMA)-F01", + "from_node": "fiber (Vannes_KBE \u2192 Lorient_KMA)-F055", "to_node": "roadm Lorient_KMA" }, { "from_node": "roadm Vannes_KBE", - "to_node": "egress edfa in Vannes_KBE to Lorient_KMA" + "to_node": "fiber (Vannes_KBE \u2192 Lorient_KMA)-F055" }, { - "from_node": "egress edfa in Vannes_KBE to Lorient_KMA", - "to_node": "fiber (Vannes_KBE \u2192 Lorient_KMA)-F01" - }, - { - "from_node": "fiber (Lorient_KMA \u2192 Vannes_KBE)-F01", + "from_node": "fiber (Lorient_KMA \u2192 Vannes_KBE)-F055", "to_node": "roadm Vannes_KBE" }, { - "from_node": "fiber (Lannion_CAS \u2192 Stbrieuc)-", - "to_node": "egress edfa in Stbrieuc to Rennes_STA" + "from_node": "fiber (Lannion_CAS \u2192 Stbrieuc)-F056", + "to_node": "fiber (Stbrieuc \u2192 Rennes_STA)-F057" }, { - "from_node": "egress edfa in Stbrieuc to Rennes_STA", - "to_node": "fiber (Stbrieuc \u2192 Rennes_STA)-" - }, - { - "from_node": "fiber (Rennes_STA \u2192 Stbrieuc)-", - "to_node": "fiber (Stbrieuc \u2192 Lannion_CAS)-" + "from_node": "fiber (Rennes_STA \u2192 Stbrieuc)-F057", + "to_node": "fiber (Stbrieuc \u2192 Lannion_CAS)-F056" }, { "from_node": "roadm Rennes_STA", - "to_node": "egress edfa in Rennes_STA to Stbrieuc" + "to_node": "fiber (Rennes_STA \u2192 Stbrieuc)-F057" }, { - "from_node": "egress edfa in Rennes_STA to Stbrieuc", - "to_node": "fiber (Rennes_STA \u2192 Stbrieuc)-" - }, - { - "from_node": "fiber (Stbrieuc \u2192 Rennes_STA)-", + "from_node": "fiber (Stbrieuc \u2192 Rennes_STA)-F057", "to_node": "roadm Rennes_STA" }, { - "from_node": "fiber (Lannion_CAS \u2192 Morlaix)-", + "from_node": "fiber (Lannion_CAS \u2192 Morlaix)-F059", "to_node": "ingress fused spans in Morlaix" }, { "from_node": "ingress fused spans in Morlaix", - "to_node": "fiber (Morlaix \u2192 Brest_KLA)-" + "to_node": "fiber (Morlaix \u2192 Brest_KLA)-F060" }, { - "from_node": "fiber (Brest_KLA \u2192 Morlaix)-", + "from_node": "fiber (Brest_KLA \u2192 Morlaix)-F060", "to_node": "egress fused spans in Morlaix" }, { "from_node": "egress fused spans in Morlaix", - "to_node": "fiber (Morlaix \u2192 Lannion_CAS)-" + "to_node": "fiber (Morlaix \u2192 Lannion_CAS)-F059" }, { "from_node": "roadm Brest_KLA", - "to_node": "egress edfa in Brest_KLA to Morlaix" + "to_node": "fiber (Brest_KLA \u2192 Morlaix)-F060" }, { - "from_node": "egress edfa in Brest_KLA to Morlaix", - "to_node": "fiber (Brest_KLA \u2192 Morlaix)-" - }, - { - "from_node": "fiber (Morlaix \u2192 Brest_KLA)-", + "from_node": "fiber (Morlaix \u2192 Brest_KLA)-F060", "to_node": "roadm Brest_KLA" }, + { + "from_node": "roadm toto", + "to_node": "fiber (toto \u2192 tata)-" + }, + { + "from_node": "fiber (tata \u2192 toto)-", + "to_node": "roadm toto" + }, + { + "from_node": "roadm tata", + "to_node": "fiber (tata \u2192 toto)-" + }, + { + "from_node": "fiber (toto \u2192 tata)-", + "to_node": "roadm tata" + }, { "from_node": "trx Lannion_CAS", "to_node": "roadm Lannion_CAS" @@ -832,6 +705,22 @@ { "from_node": "roadm Brest_KLA", "to_node": "trx Brest_KLA" + }, + { + "from_node": "trx toto", + "to_node": "roadm toto" + }, + { + "from_node": "roadm toto", + "to_node": "trx toto" + }, + { + "from_node": "trx tata", + "to_node": "roadm tata" + }, + { + "from_node": "roadm tata", + "to_node": "trx tata" } ] } \ No newline at end of file diff --git a/examples/meshTopologyExampleV2.xls b/examples/meshTopologyExampleV2.xls index 34f2ffb2676b0a5dacc14affa3e3426f88cb0b82..ce9d54fa3728a57a14c100c2d1ab0372232cef6f 100644 GIT binary patch delta 3649 zcmZ`+U2I$R6+idG*Z117Z_<3!`Sf+&eAr3aG^7o5l-6P07)_xl2&rOHa2o?2iLbF; zM$`>w8+{rN6Mt!wRtYqz>H|DX!-74a0*?%74@l(&sVG8-7uduDPoNQg=YOy7bqu?f zB{5`Q8jYj?n%BuKJ;!YACHQa{FKgC9|^+EDQwdhtGWw%n?oF;nM zzjd6M&2qirxKBD2_Q7em&ZUxbx#rgErH$NNhvd9-5&W%Eu~K(xrOo2=K-FU7Y3H(A zsW)oHa-|{8_02b7@;p@8L~GmiMrrG$Q?C{;mn%=9er-y*QoYh}s_w5#HD_jHWh*xn z@+z0uo6AoZE0xk_9gLcLrGeuoosDw+S1!yrPuAQmWG-N^8wY&cWXW>f*>v4{=`^Gs zbGM66m1^t9PCQaLkCe&ZMWU5jsoq#Ww_0$1_~n6 z+{)QLqUTDL4YyWUZ`7WjZ){gf$1I`?YwK$lPAsi^_qGQX_b7%oGEMPj-(GRM&n6YM z`7QOJF%;TOgjfY`PsX4W#X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*@TbZXi9mEJisigNNsi{kcr?Tz+`JeR#(3*9xxKIGMZ55oTyTo;4(ZMjfO9jXB5zw824M>ZSXEgr>ub54Lk! zP$gHZ82j^~331wJ&w*x(fOSdvP~JFgg0VKy3&gEq#Px`)C%a)m$IcFty#>j zg~$!fI*D>Ka!SQFCov(a+^izLYhiF_vc%HiFj|#8hbcMO?~)g1pjJ76(rh7r#g9?k zH2yz@fGayRxh6FrU&pt&5iHqn)w3%2oPQ9@YgD?$FTqJVNpmz!hv^_4!tWGK&@9aqX@&~) zB#2p1moo_})5%on`0umW$KE^d-|O z{!e)|rNyVRo0f)zBQ%Bdx_Ev5r_-F5_7C&oj{cW+75`0L|`(5ic>f5|b>tg{$yO~au)e|^nt?75Q>u$kIf+JT-hl+uvLMZCLmG1^-OCw*UYD diff --git a/examples/path_requests_run.py b/examples/path_requests_run.py index 32eac5ec..a544efec 100644 --- a/examples/path_requests_run.py +++ b/examples/path_requests_run.py @@ -27,7 +27,7 @@ from numpy import mean from examples.convert_service_sheet import convert_service_sheet, Request_element, Element from gnpy.core.utils import load_json from gnpy.core import network_from_json, build_network -from gnpy.core.equipment import read_eqpt_library +from examples.transmission_main_example import load_equipment, load_network from examples.convert import convert_file from gnpy.core.elements import Transceiver, Roadm, Edfa, Fused from gnpy.core.utils import db2lin, lin2db @@ -198,37 +198,37 @@ def load_requests(filename,eqpt_filename): json_data = loads(f.read()) return json_data -def load_network(filename,eqpt_filename): - # to be replaced with the good load_network - # important note: network should be created only once for a given - # simulation. Note that it only generates infrastructure information. - # Only one transceiver element is attached per roadm: it represents the - # logical starting point / stopping point for the propagation of - # the spectral information to be prpagated along a path. - # at that point it is not meant to represent the capacity of add drop ports - # As a result transponder type is not part of the network info. it is related to - # the list of services requests +# def load_network(filename,eqpt_filename): +# # to be replaced with the good load_network +# # important note: network should be created only once for a given +# # simulation. Note that it only generates infrastructure information. +# # Only one transceiver element is attached per roadm: it represents the +# # logical starting point / stopping point for the propagation of +# # the spectral information to be prpagated along a path. +# # at that point it is not meant to represent the capacity of add drop ports +# # As a result transponder type is not part of the network info. it is related to +# # the list of services requests - input_filename = str(filename) - suffix_filename = str(filename.suffixes[0]) - split_filename = [input_filename[0:len(input_filename)-len(suffix_filename)] , suffix_filename[1:]] - json_filename = split_filename[0]+'.json' - try: - assert split_filename[1] in ('json','xls','csv','xlsm') - except AssertionError as e: - print(f'invalid file extension .{split_filename[1]}') - raise e - if split_filename[1] != 'json': - print(f'parse excel input to {json_filename}') - convert_file(filename) +# input_filename = str(filename) +# suffix_filename = str(filename.suffixes[0]) +# split_filename = [input_filename[0:len(input_filename)-len(suffix_filename)] , suffix_filename[1:]] +# json_filename = split_filename[0]+'.json' +# try: +# assert split_filename[1] in ('json','xls','csv','xlsm') +# except AssertionError as e: +# print(f'invalid file extension .{split_filename[1]}') +# raise e +# if split_filename[1] != 'json': +# print(f'parse excel input to {json_filename}') +# convert_file(filename) - json_data = load_json(json_filename) - read_eqpt_library(eqpt_filename) - #print(json_data) +# json_data = load_json(json_filename) +# read_eqpt_library(eqpt_filename) +# #print(json_data) - network = network_from_json(json_data) - build_network(network) - return network +# network = network_from_json(json_data) +# build_network(network) +# return network def compute_path(network, pathreqlist): # temporary : repeats calls from transmission_main_example @@ -320,7 +320,9 @@ if __name__ == '__main__': # for debug # print( args.eqpt_filename) data = load_requests(args.service_filename,args.eqpt_filename) - network = load_network(args.network_filename,args.eqpt_filename) + equipment = load_equipment(args.eqpt_filename) + network = load_network(args.network_filename,equipment) + build_network(network, equipment=equipment) pths = requests_from_json(data, args.eqpt_filename) test = compute_path(network,pths) diff --git a/examples/transmission_main_example.py b/examples/transmission_main_example.py index 0f164441..35e3a48b 100755 --- a/examples/transmission_main_example.py +++ b/examples/transmission_main_example.py @@ -51,13 +51,13 @@ def plot_results(network, path, source, sink): def load_network(filename, equipment): json_filename = '' - if args.filename.suffix.lower() == '.xls': + if filename.suffix.lower() == '.xls': logger.info('Automatically generating topology JSON file') - json_filename = convert_file(args.filename) - elif args.filename.suffix.lower() == '.json': - json_filename = args.filename + json_filename = convert_file(filename) + elif filename.suffix.lower() == '.json': + json_filename = filename else: - raise ValueError(f'unsuported topology filename extension {args.filename.suffix.lower()}') + raise ValueError(f'unsuported topology filename extension {filename.suffix.lower()}') json_data = load_json(json_filename) return network_from_json(json_data, equipment)