mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
fix: Handle ZeroDivisionError in PageRank calculation
This commit is contained in:
parent
ed1eb38c5f
commit
a4b79127b0
1 changed files with 5 additions and 1 deletions
|
@ -398,7 +398,11 @@ class RepoMap:
|
||||||
try:
|
try:
|
||||||
ranked = nx.pagerank(G, weight="weight", **pers_args)
|
ranked = nx.pagerank(G, weight="weight", **pers_args)
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
return []
|
# Issue #1536
|
||||||
|
try:
|
||||||
|
ranked = nx.pagerank(G, weight="weight")
|
||||||
|
except ZeroDivisionError:
|
||||||
|
return []
|
||||||
|
|
||||||
# distribute the rank from each source node, across all of its out edges
|
# distribute the rank from each source node, across all of its out edges
|
||||||
ranked_definitions = defaultdict(float)
|
ranked_definitions = defaultdict(float)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue