Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Change-Id: If7860b243cb504613a7fffafad2d601510000af7
  • Loading branch information
jktjkt committed Jan 14, 2020
2 parents 2ea3363 + 0f10ac7 commit bfe68a5
Show file tree
Hide file tree
Showing 23 changed files with 2,542 additions and 692 deletions.
8 changes: 8 additions & 0 deletions examples/meshTopologyExampleV2_services.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"destination": "trx Vannes_KBE",
"src-tp-id": "trx Lorient_KMA",
"dst-tp-id": "trx Vannes_KBE",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand All @@ -30,6 +31,7 @@
"destination": "trx Vannes_KBE",
"src-tp-id": "trx Brest_KLA",
"dst-tp-id": "trx Vannes_KBE",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand Down Expand Up @@ -94,6 +96,7 @@
"destination": "trx Rennes_STA",
"src-tp-id": "trx Lannion_CAS",
"dst-tp-id": "trx Rennes_STA",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand All @@ -118,6 +121,7 @@
"destination": "trx Lannion_CAS",
"src-tp-id": "trx Rennes_STA",
"dst-tp-id": "trx Lannion_CAS",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand All @@ -142,6 +146,7 @@
"destination": "trx Lannion_CAS",
"src-tp-id": "trx Rennes_STA",
"dst-tp-id": "trx Lannion_CAS",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand All @@ -166,6 +171,7 @@
"destination": "trx Lorient_KMA",
"src-tp-id": "trx Lannion_CAS",
"dst-tp-id": "trx Lorient_KMA",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand All @@ -190,6 +196,7 @@
"destination": "trx Lorient_KMA",
"src-tp-id": "trx Lannion_CAS",
"dst-tp-id": "trx Lorient_KMA",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand All @@ -214,6 +221,7 @@
"destination": "trx Lorient_KMA",
"src-tp-id": "trx Lannion_CAS",
"dst-tp-id": "trx Lorient_KMA",
"bidirectional": false,
"path-constraints": {
"te-bandwidth": {
"technology": "flexi-grid",
Expand Down
438 changes: 285 additions & 153 deletions examples/path_requests_run.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/transmission_main_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def main(network, equipment, source, destination, sim_params, req=None):
params['trx_mode'] = ''
params['source'] = source.uid
params['destination'] = destination.uid
params['bidir'] = False
params['nodes_list'] = [destination.uid]
params['loose_list'] = ['strict']
params['format'] = ''
Expand Down
10 changes: 7 additions & 3 deletions gnpy/core/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from pathlib import Path
from difflib import get_close_matches
from gnpy.core.utils import silent_remove
from gnpy.core.exceptions import NetworkTopologyError
import time

all_rows = lambda sh, start=0: (sh.row(x) for x in range(start, sh.nrows))
Expand Down Expand Up @@ -509,9 +510,12 @@ def parse_excel(input_filename):
all_cities = Counter(n.city for n in nodes)
if len(all_cities) != len(nodes):
raise ValueError(f'Duplicate city: {all_cities}')
if any(ln.from_city not in all_cities or
ln.to_city not in all_cities for ln in links):
raise ValueError(f'Bad link.')
bad_links = []
for lnk in links:
if lnk.from_city not in all_cities or lnk.to_city not in all_cities:
bad_links.append([lnk.from_city, lnk.to_city])
if bad_links:
raise NetworkTopologyError(f'Bad link(s): {bad_links}.')

return nodes, links, eqpts

Expand Down
10 changes: 10 additions & 0 deletions gnpy/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ class EquipmentConfigError(ConfigurationError):

class NetworkTopologyError(ConfigurationError):
'''Topology of user-provided network is wrong'''

class ServiceError(Exception):
'''Service of user-provided request is wrong'''

class DisjunctionError(ServiceError):
'''Disjunction of user-provided request can not be satisfied'''

class SpectrumError(Exception):
'''Spectrum errors of the program'''

Loading

0 comments on commit bfe68a5

Please sign in to comment.