Removing extra spaces, trailing spaces and adding missing spaces
for codacy report:
removing extra spces before , and :
adding spaces after , :
adding spaces around < > =
@@ -196,12 +196,11 @@ def compute_path_with_disjunction(network, equipment, pathreqlist, pathlist):
# print(f'{pathreq.baud_rate} {pathreq.power} {pathreq.spacing} {pathreq.nb_channel}')
if total_path:
if pathreq.baud_rate is not None:
- # means that at this point the mode was entered/forced by user and thus a baud_rate was defined
+ # means that at this point the mode was entered/forced by user and thus a
+ # baud_rate was defined
total_path = propagate(total_path, pathreq, equipment)
temp_snr01nm = round(mean(total_path[-1].snr+lin2db(pathreq.baud_rate/(12.5e9))), 2)
if temp_snr01nm < pathreq.OSNR:
- # means that at this point the mode was entered/forced by user and thus a
- # baud_rate was defined
msg = f'\tWarning! Request {pathreq.request_id} computed path from' +\
f' {pathreq.source} to {pathreq.destination} does not pass with' +\
f' {pathreq.tsp_mode}\n\tcomputedSNR in 0.1nm = {temp_snr01nm} ' +\
@@ -379,7 +378,6 @@ if __name__ == '__main__':
print('\x1b[1;34;40m' + f'Computing all paths with constraints' + '\x1b[0m')
pths = compute_path_dsjctn(network, equipment, rqs, dsjn)
- print('\x1b[1;34;40m'+f'Propagating on selected path'+ '\x1b[0m')
propagatedpths = compute_path_with_disjunction(network, equipment, rqs, pths)
# Note that deepcopy used in compute_path_with_disjunction retrns a list of nodes which are not belonging to
# network (they are copies of the node objects). so there can not be propagation on these nodes.
@@ -400,6 +398,7 @@ if __name__ == '__main__':
else:
reversed_propagatedpths.append([])
reversed_pths.append([])
+ print('\x1b[1;34;40m' + f'Propagating on selected path' + '\x1b[0m')
pth_assign_spectrum(pths, rqs, oms_list,reversed_pths)
