Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility Networkx 2 #601

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions odo/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ 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

def path_part(src, tgt):
node = edge[src][tgt]
#node = edge[src][tgt]
node = graph[src][tgt]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the comments? A git blame on github should suffice in referencing the change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done.

return PathPart(src, tgt, node['func'], node['cost'])

return map(path_part, pth, pth[1:])
Expand All @@ -189,7 +189,7 @@ def without_edges(g, edges):
edges = edges or []
held = dict()
for a, b in edges:
held[(a, b)] = g.edge[a][b]
held[(a, b)] = g[a][b]
g.remove_edge(a, b)

try:
Expand Down