From 8a4904c54d5f4f8d498ffac57b634caee739fff0 Mon Sep 17 00:00:00 2001 From: "ANALYTICS\\OrengoM" Date: Wed, 10 Jan 2018 14:08:50 -0500 Subject: [PATCH 1/2] Compatibility Networkx 2 --- odo/core.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/odo/core.py b/odo/core.py index fdae78d6..00b75bc5 100644 --- a/odo/core.py +++ b/odo/core.py @@ -169,10 +169,14 @@ def path(graph, source, target, excluded_edges=None, ooc_types=ooc_types): if issubclass(n, oocs)]) with without_edges(graph, excluded_edges) as g: pth = nx.shortest_path(g, source=source, target=target, weight='cost') - edge = graph.edge + #https: // github.com / blaze / odo / issues / 579 + #https://github.com/blaze/odo/issues/588 + #node can be retrieved from graph via dict-like access + #edge = graph.edge def path_part(src, tgt): - node = edge[src][tgt] + #node = edge[src][tgt] + node = graph[src][tgt] return PathPart(src, tgt, node['func'], node['cost']) return map(path_part, pth, pth[1:]) @@ -189,7 +193,10 @@ def without_edges(g, edges): edges = edges or [] held = dict() for a, b in edges: - held[(a, b)] = g.edge[a][b] + #https: // github.com / blaze / odo / issues / 579 + #https://github.com/blaze/odo/issues/588 + #held[(a, b)] = g.edge[a][b] + held[(a, b)] = g[a][b] g.remove_edge(a, b) try: From f917eb7ed0b017e4f490c1bea166caab7347251f Mon Sep 17 00:00:00 2001 From: "ANALYTICS\\OrengoM" Date: Mon, 19 Feb 2018 11:33:12 -0500 Subject: [PATCH 2/2] Removed comments --- odo/core.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/odo/core.py b/odo/core.py index 00b75bc5..5c01d3ed 100644 --- a/odo/core.py +++ b/odo/core.py @@ -169,10 +169,6 @@ def path(graph, source, target, excluded_edges=None, ooc_types=ooc_types): if issubclass(n, oocs)]) with without_edges(graph, excluded_edges) as g: pth = nx.shortest_path(g, source=source, target=target, weight='cost') - #https: // github.com / blaze / odo / issues / 579 - #https://github.com/blaze/odo/issues/588 - #node can be retrieved from graph via dict-like access - #edge = graph.edge def path_part(src, tgt): #node = edge[src][tgt] @@ -193,9 +189,6 @@ def without_edges(g, edges): edges = edges or [] held = dict() for a, b in edges: - #https: // github.com / blaze / odo / issues / 579 - #https://github.com/blaze/odo/issues/588 - #held[(a, b)] = g.edge[a][b] held[(a, b)] = g[a][b] g.remove_edge(a, b)