Skip to content

Commit

Permalink
Bump to latest networkx and adjust code.
Browse files Browse the repository at this point in the history
  • Loading branch information
knumor committed Dec 19, 2018
1 parent 574a83c commit b32bdde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
matplotlib
networkx==1.11
networkx==2.2
gnureadline
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def reciprocity(G):
"""Calculate reciprocity of graph, i.e. the ratio of the edges in
one direction that have and edge going in the other direction."""
return sum([G.has_edge(e[1], e[0])
for e in G.edges_iter()]) / float(G.number_of_edges())
for e in G.edges]) / float(G.number_of_edges())

def short_names(names):
labels = {}
Expand Down

0 comments on commit b32bdde

Please sign in to comment.