From 8a96ff563e281729a33e9b0a98875bd3e67fe58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Mon, 31 May 2021 20:11:28 +0200 Subject: [PATCH 1/3] remove unused import Change-Id: Id92bda6263a1b8db70d9142970522c504c10126d --- gnpy/tools/cli_examples.py | 1 - 1 file changed, 1 deletion(-) diff --git a/gnpy/tools/cli_examples.py b/gnpy/tools/cli_examples.py index 3b14dcdb..0f72b9cb 100644 --- a/gnpy/tools/cli_examples.py +++ b/gnpy/tools/cli_examples.py @@ -9,7 +9,6 @@ Common code for CLI examples ''' import argparse -from json import dumps import logging import os.path import sys From e25e1fbe50d72cd74c5777d7e47020354ffe9f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Mon, 31 May 2021 20:13:38 +0200 Subject: [PATCH 2/3] remove unused variable It was only assigned to in `read_service_sheet`, and it's safe to remove it also in `convert_service_sheet`. Change-Id: Ia832cd8fea2d864e920907e455e834a3c3a724dd --- gnpy/tools/json_io.py | 5 ++--- gnpy/tools/service_sheet.py | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gnpy/tools/json_io.py b/gnpy/tools/json_io.py index a7cc131b..f4d00987 100644 --- a/gnpy/tools/json_io.py +++ b/gnpy/tools/json_io.py @@ -534,10 +534,9 @@ def convert_service_sheet( network, network_filename=None, output_filename='', - bidir=False, - filter_region=None): + bidir=False): if output_filename == '': output_filename = f'{str(input_filename)[0:len(str(input_filename))-len(str(input_filename.suffixes[0]))]}_services.json' - data = read_service_sheet(input_filename, eqpt, network, network_filename, bidir, filter_region) + data = read_service_sheet(input_filename, eqpt, network, network_filename, bidir) save_json(data, output_filename) return data diff --git a/gnpy/tools/service_sheet.py b/gnpy/tools/service_sheet.py index 6d4eb829..cf4c4b74 100644 --- a/gnpy/tools/service_sheet.py +++ b/gnpy/tools/service_sheet.py @@ -178,12 +178,9 @@ def read_service_sheet( eqpt, network, network_filename=None, - bidir=False, - filter_region=None): + bidir=False): """ converts a service sheet into a json structure """ - if filter_region is None: - filter_region = [] if network_filename is None: network_filename = input_filename service = parse_excel(input_filename) From 38fc1fdc6da11adbfc31cb2c1e9e6f030bfbdb31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Mon, 31 May 2021 20:15:25 +0200 Subject: [PATCH 3/3] Remove unused variables Change-Id: I8523fb938123ec9767eb9f540b229ddca23b9da5 --- gnpy/tools/convert.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/gnpy/tools/convert.py b/gnpy/tools/convert.py index 756ebf3e..bd468948 100755 --- a/gnpy/tools/convert.py +++ b/gnpy/tools/convert.py @@ -694,8 +694,6 @@ def connect_eqpt(from_, in_, to_): def eqpt_in_city_to_city(in_city, to_city, direction='east'): rev_direction = 'west' if direction == 'east' else 'east' - amp_direction = f'{direction}_amp_type' - amp_rev_direction = f'{rev_direction}_amp_type' return_eqpt = '' if in_city in eqpts_by_city: for e in eqpts_by_city[in_city]: @@ -705,7 +703,6 @@ def eqpt_in_city_to_city(in_city, to_city, direction='east'): elif nodes_by_city[in_city].node_type.lower() == 'ila': if e.to_city != to_city: direction = rev_direction - amp_direction = amp_rev_direction return_eqpt = f'{direction} edfa in {e.from_city} to {e.to_city}' elif nodes_by_city[in_city].node_type.lower() == 'ila': return_eqpt = f'{direction} edfa in {in_city}'