{"action":"created","comment":{"url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/comments/177545197","pull_request_review_id":107435350,"id":177545197,"diff_hunk":"@@ -47,40 +47,55 @@ def main(args):\n             32e9, 0.15, Power(1e-3, 0, 0)) for f in range(1,97)))\n \n     trx = [n for n in network.nodes() if isinstance(n, Transceiver)]\n-    source, sink = trx[0], trx[1]\n- \n-    path = dijkstra_path(network, source, sink)\n-    print(f'There are {len(path)} network elements between {source} and {sink}')\n-\n-    for el in path:\n-        si = el(si)\n-        print(el)\n-\n-    nodelist = [n for n in network.nodes() if isinstance(n, (Transceiver, Fiber))]\n-    pathnodes = [n for n in path if isinstance(n, (Transceiver, Fiber))]\n-    edgelist = [(u, v) for u, v in zip(pathnodes, pathnodes[1:])]\n-    node_color = ['#ff0000' if n is source or n is sink else\n-                  '#900000' if n in path else '#ffdfdf'\n-                  for n in nodelist]\n-    edge_color = ['#ff9090' if u in path and v in path else '#ababab'\n-                  for u, v in edgelist]\n-    labels = {n: n.location.city if isinstance(n, Transceiver) else ''\n-              for n in pathnodes}\n-\n-    fig = figure()\n-    pos = {n: (n.lng, n.lat) for n in nodelist}\n-    kwargs = {'figure': fig, 'pos': pos}\n-    plot = draw_networkx_nodes(network, nodelist=nodelist, node_color=node_color, **kwargs)\n-    draw_networkx_edges(network, edgelist=edgelist, edge_color=edge_color, **kwargs)\n-    draw_networkx_labels(network, labels=labels, font_size=14, **kwargs)\n-    title(f'Propagating from {source.loc.city} to {sink.loc.city}')\n-    axis('off')\n-    show()\n+    if args.list>=1:\n+        for el in trx:\n+            print(el.uid[4:])\n+    else:\n+        source, sink = trx[0], trx[1]\n+        for el in trx:\n+            if args.source == el.uid[4:]:\n+                print(args.source)\n+                source = el\n+                print(source)\n+            if args.sink == el.uid[4:]:\n+                print(args.sink)\n+                sink = el\n+\n+        path = dijkstra_path(network, source, sink)\n+        print(f'There are {len(path)} network elements between {source} and {sink}')\n+\n+        for el in path:\n+            si = el(si)\n+            print(el)\n+\n+        nodelist = [n for n in network.nodes() if isinstance(n, (Transceiver, Fiber))]\n+        pathnodes = [n for n in path if isinstance(n, (Transceiver, Fiber))]\n+        edgelist = [(u, v) for u, v in zip(pathnodes, pathnodes[1:])]\n+        node_color = ['#ff0000' if n is source or n is sink else\n+                      '#900000' if n in path else '#ffdfdf'\n+                      for n in nodelist]\n+        edge_color = ['#ff9090' if u in path and v in path else '#ababab'\n+                      for u, v in edgelist]\n+        labels = {n: n.location.city if isinstance(n, Transceiver) else ''\n+                  for n in pathnodes}\n+\n+        fig = figure()\n+        pos = {n: (n.lng, n.lat) for n in nodelist}\n+        kwargs = {'figure': fig, 'pos': pos}\n+        plot = draw_networkx_nodes(network, nodelist=nodelist, node_color=node_color, **kwargs)\n+        draw_networkx_edges(network, edgelist=edgelist, edge_color=edge_color, **kwargs)\n+        draw_networkx_labels(network, labels=labels, font_size=14, **kwargs)\n+        title(f'Propagating from {source.loc.city} to {sink.loc.city}')\n+        axis('off')\n+        show()\n \n parser = ArgumentParser()\n parser.add_argument('filename', nargs='?', type=Path,\n   default= Path(__file__).parent / 'edfa/edfa_example_network.json')\n+parser.add_argument('source', type=str, nargs='?', default=\"\", help='source node')\n+parser.add_argument('sink', type=str, nargs='?', default=\"\", help='sink node')\n parser.add_argument('-v', '--verbose', action='count')\n+parser.add_argument('-l', '--list', action='count', default=0, help='list all network nodes')","path":"examples/transmission_main_example.py","position":81,"original_position":81,"commit_id":"a3c16e16fe728e4cd2c7fb8d85e63cf482aa5d74","original_commit_id":"a3c16e16fe728e4cd2c7fb8d85e63cf482aa5d74","user":{"login":"dutc","id":3922744,"avatar_url":"https://avatars3.githubusercontent.com/u/3922744?v=4","gravatar_id":"","url":"https://api.github.com/users/dutc","html_url":"https://github.com/dutc","followers_url":"https://api.github.com/users/dutc/followers","following_url":"https://api.github.com/users/dutc/following{/other_user}","gists_url":"https://api.github.com/users/dutc/gists{/gist_id}","starred_url":"https://api.github.com/users/dutc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dutc/subscriptions","organizations_url":"https://api.github.com/users/dutc/orgs","repos_url":"https://api.github.com/users/dutc/repos","events_url":"https://api.github.com/users/dutc/events{/privacy}","received_events_url":"https://api.github.com/users/dutc/received_events","type":"User","site_admin":false},"body":"This should be `action='store_true'` rather than `action='count'`.\r\n\r\nCan you call this parameter \"list-nodes\" to make it clear what it is listing?\r\n\r\nYou can check if the parameter was passed by simply\r\n`\r\nif args.list_nodes:\r\n  ...\r\n`\r\n","created_at":"2018-03-27T19:29:04Z","updated_at":"2018-03-27T19:39:53Z","html_url":"https://github.com/Telecominfraproject/gnpy/pull/44#discussion_r177545197","pull_request_url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/comments/177545197"},"html":{"href":"https://github.com/Telecominfraproject/gnpy/pull/44#discussion_r177545197"},"pull_request":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44","id":177503478,"html_url":"https://github.com/Telecominfraproject/gnpy/pull/44","diff_url":"https://github.com/Telecominfraproject/gnpy/pull/44.diff","patch_url":"https://github.com/Telecominfraproject/gnpy/pull/44.patch","issue_url":"https://api.github.com/repos/Telecominfraproject/gnpy/issues/44","number":44,"state":"open","locked":false,"title":"Add source sink arguments, restore convert.py","user":{"login":"jeanluc-auge","id":29375413,"avatar_url":"https://avatars2.githubusercontent.com/u/29375413?v=4","gravatar_id":"","url":"https://api.github.com/users/jeanluc-auge","html_url":"https://github.com/jeanluc-auge","followers_url":"https://api.github.com/users/jeanluc-auge/followers","following_url":"https://api.github.com/users/jeanluc-auge/following{/other_user}","gists_url":"https://api.github.com/users/jeanluc-auge/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanluc-auge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanluc-auge/subscriptions","organizations_url":"https://api.github.com/users/jeanluc-auge/orgs","repos_url":"https://api.github.com/users/jeanluc-auge/repos","events_url":"https://api.github.com/users/jeanluc-auge/events{/privacy}","received_events_url":"https://api.github.com/users/jeanluc-auge/received_events","type":"User","site_admin":false},"body":"demonstrate mesh routing capability with source & sink options\r\npython transmission_main_example.py coronet_conus_example.json Toledo Syracuse\r\n=> path feasibility from Toledo to Syracuse\r\npython transmission_main_example.py coronet_conus_example.json -l\r\n=> list all possible source and destination nodes\r\nreadd CORONET xls and convert.py parser from xls to json\r\n\r\nSigned-off-by: Jean-Luc Auge <jeanluc.auge@orange.com>","created_at":"2018-03-26T16:40:40Z","updated_at":"2018-03-27T19:39:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"551d3530cbd250c7e96e6ebc190f718dbc65d543","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44/commits","review_comments_url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44/comments","review_comment_url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Telecominfraproject/gnpy/issues/44/comments","statuses_url":"https://api.github.com/repos/Telecominfraproject/gnpy/statuses/a3c16e16fe728e4cd2c7fb8d85e63cf482aa5d74","head":{"label":"Orange-OpenSource:develop","ref":"develop","sha":"a3c16e16fe728e4cd2c7fb8d85e63cf482aa5d74","user":{"login":"Orange-OpenSource","id":1506386,"avatar_url":"https://avatars0.githubusercontent.com/u/1506386?v=4","gravatar_id":"","url":"https://api.github.com/users/Orange-OpenSource","html_url":"https://github.com/Orange-OpenSource","followers_url":"https://api.github.com/users/Orange-OpenSource/followers","following_url":"https://api.github.com/users/Orange-OpenSource/following{/other_user}","gists_url":"https://api.github.com/users/Orange-OpenSource/gists{/gist_id}","starred_url":"https://api.github.com/users/Orange-OpenSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orange-OpenSource/subscriptions","organizations_url":"https://api.github.com/users/Orange-OpenSource/orgs","repos_url":"https://api.github.com/users/Orange-OpenSource/repos","events_url":"https://api.github.com/users/Orange-OpenSource/events{/privacy}","received_events_url":"https://api.github.com/users/Orange-OpenSource/received_events","type":"Organization","site_admin":false},"repo":{"id":101062316,"name":"gnpy","full_name":"Orange-OpenSource/gnpy","owner":{"login":"Orange-OpenSource","id":1506386,"avatar_url":"https://avatars0.githubusercontent.com/u/1506386?v=4","gravatar_id":"","url":"https://api.github.com/users/Orange-OpenSource","html_url":"https://github.com/Orange-OpenSource","followers_url":"https://api.github.com/users/Orange-OpenSource/followers","following_url":"https://api.github.com/users/Orange-OpenSource/following{/other_user}","gists_url":"https://api.github.com/users/Orange-OpenSource/gists{/gist_id}","starred_url":"https://api.github.com/users/Orange-OpenSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Orange-OpenSource/subscriptions","organizations_url":"https://api.github.com/users/Orange-OpenSource/orgs","repos_url":"https://api.github.com/users/Orange-OpenSource/repos","events_url":"https://api.github.com/users/Orange-OpenSource/events{/privacy}","received_events_url":"https://api.github.com/users/Orange-OpenSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Orange-OpenSource/gnpy","description":"Gaussian Noise Model for optical feasibility simulation","fork":true,"url":"https://api.github.com/repos/Orange-OpenSource/gnpy","forks_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/forks","keys_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/teams","hooks_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/hooks","issue_events_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/issues/events{/number}","events_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/events","assignees_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/assignees{/user}","branches_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/branches{/branch}","tags_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/tags","blobs_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/statuses/{sha}","languages_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/languages","stargazers_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/stargazers","contributors_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/contributors","subscribers_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/subscribers","subscription_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/subscription","commits_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/contents/{+path}","compare_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/merges","archive_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/downloads","issues_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/issues{/number}","pulls_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/pulls{/number}","milestones_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/milestones{/number}","notifications_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/labels{/name}","releases_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/releases{/id}","deployments_url":"https://api.github.com/repos/Orange-OpenSource/gnpy/deployments","created_at":"2017-08-22T12:50:57Z","updated_at":"2018-03-26T16:34:45Z","pushed_at":"2018-03-26T16:34:43Z","git_url":"git://github.com/Orange-OpenSource/gnpy.git","ssh_url":"git@github.com:Orange-OpenSource/gnpy.git","clone_url":"https://github.com/Orange-OpenSource/gnpy.git","svn_url":"https://github.com/Orange-OpenSource/gnpy","homepage":null,"size":356,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Telecominfraproject:develop","ref":"develop","sha":"c5a52fdb6ddf471144e2f9058071877180e56e70","user":{"login":"Telecominfraproject","id":22238180,"avatar_url":"https://avatars2.githubusercontent.com/u/22238180?v=4","gravatar_id":"","url":"https://api.github.com/users/Telecominfraproject","html_url":"https://github.com/Telecominfraproject","followers_url":"https://api.github.com/users/Telecominfraproject/followers","following_url":"https://api.github.com/users/Telecominfraproject/following{/other_user}","gists_url":"https://api.github.com/users/Telecominfraproject/gists{/gist_id}","starred_url":"https://api.github.com/users/Telecominfraproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Telecominfraproject/subscriptions","organizations_url":"https://api.github.com/users/Telecominfraproject/orgs","repos_url":"https://api.github.com/users/Telecominfraproject/repos","events_url":"https://api.github.com/users/Telecominfraproject/events{/privacy}","received_events_url":"https://api.github.com/users/Telecominfraproject/received_events","type":"Organization","site_admin":false},"repo":{"id":96894149,"name":"gnpy","full_name":"Telecominfraproject/gnpy","owner":{"login":"Telecominfraproject","id":22238180,"avatar_url":"https://avatars2.githubusercontent.com/u/22238180?v=4","gravatar_id":"","url":"https://api.github.com/users/Telecominfraproject","html_url":"https://github.com/Telecominfraproject","followers_url":"https://api.github.com/users/Telecominfraproject/followers","following_url":"https://api.github.com/users/Telecominfraproject/following{/other_user}","gists_url":"https://api.github.com/users/Telecominfraproject/gists{/gist_id}","starred_url":"https://api.github.com/users/Telecominfraproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Telecominfraproject/subscriptions","organizations_url":"https://api.github.com/users/Telecominfraproject/orgs","repos_url":"https://api.github.com/users/Telecominfraproject/repos","events_url":"https://api.github.com/users/Telecominfraproject/events{/privacy}","received_events_url":"https://api.github.com/users/Telecominfraproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Telecominfraproject/gnpy","description":"Optical Route Planning Based on Gaussian Noise Model","fork":false,"url":"https://api.github.com/repos/Telecominfraproject/gnpy","forks_url":"https://api.github.com/repos/Telecominfraproject/gnpy/forks","keys_url":"https://api.github.com/repos/Telecominfraproject/gnpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Telecominfraproject/gnpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Telecominfraproject/gnpy/teams","hooks_url":"https://api.github.com/repos/Telecominfraproject/gnpy/hooks","issue_events_url":"https://api.github.com/repos/Telecominfraproject/gnpy/issues/events{/number}","events_url":"https://api.github.com/repos/Telecominfraproject/gnpy/events","assignees_url":"https://api.github.com/repos/Telecominfraproject/gnpy/assignees{/user}","branches_url":"https://api.github.com/repos/Telecominfraproject/gnpy/branches{/branch}","tags_url":"https://api.github.com/repos/Telecominfraproject/gnpy/tags","blobs_url":"https://api.github.com/repos/Telecominfraproject/gnpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Telecominfraproject/gnpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Telecominfraproject/gnpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/Telecominfraproject/gnpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Telecominfraproject/gnpy/statuses/{sha}","languages_url":"https://api.github.com/repos/Telecominfraproject/gnpy/languages","stargazers_url":"https://api.github.com/repos/Telecominfraproject/gnpy/stargazers","contributors_url":"https://api.github.com/repos/Telecominfraproject/gnpy/contributors","subscribers_url":"https://api.github.com/repos/Telecominfraproject/gnpy/subscribers","subscription_url":"https://api.github.com/repos/Telecominfraproject/gnpy/subscription","commits_url":"https://api.github.com/repos/Telecominfraproject/gnpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/Telecominfraproject/gnpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/Telecominfraproject/gnpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/Telecominfraproject/gnpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/Telecominfraproject/gnpy/contents/{+path}","compare_url":"https://api.github.com/repos/Telecominfraproject/gnpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Telecominfraproject/gnpy/merges","archive_url":"https://api.github.com/repos/Telecominfraproject/gnpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Telecominfraproject/gnpy/downloads","issues_url":"https://api.github.com/repos/Telecominfraproject/gnpy/issues{/number}","pulls_url":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls{/number}","milestones_url":"https://api.github.com/repos/Telecominfraproject/gnpy/milestones{/number}","notifications_url":"https://api.github.com/repos/Telecominfraproject/gnpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Telecominfraproject/gnpy/labels{/name}","releases_url":"https://api.github.com/repos/Telecominfraproject/gnpy/releases{/id}","deployments_url":"https://api.github.com/repos/Telecominfraproject/gnpy/deployments","created_at":"2017-07-11T13:08:42Z","updated_at":"2018-03-22T17:17:29Z","pushed_at":"2018-03-26T16:40:40Z","git_url":"git://github.com/Telecominfraproject/gnpy.git","ssh_url":"git@github.com:Telecominfraproject/gnpy.git","clone_url":"https://github.com/Telecominfraproject/gnpy.git","svn_url":"https://github.com/Telecominfraproject/gnpy","homepage":"","size":362,"stargazers_count":15,"watchers_count":15,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":9,"open_issues":2,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44"},"html":{"href":"https://github.com/Telecominfraproject/gnpy/pull/44"},"issue":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/issues/44"},"comments":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/Telecominfraproject/gnpy/statuses/a3c16e16fe728e4cd2c7fb8d85e63cf482aa5d74"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dutc"}}