Handle the case where there is no rank flow

This commit is contained in:
Paul Gauthier 2023-06-04 09:53:09 -07:00
parent 91f48dfdf1
commit 12512df707

View file

@ -277,7 +277,10 @@ class RepoMap:
else:
pers_args = dict()
ranked = nx.pagerank(G, weight="weight", **pers_args)
try:
ranked = nx.pagerank(G, weight="weight", **pers_args)
except ZeroDivisionError:
return []
# top_rank = sorted([(rank, node) for (node, rank) in ranked.items()], reverse=True)
# Print the PageRank of each node