Skip to content

Commit

Permalink
Trac #27811: fix doctest with igraph
Browse files Browse the repository at this point in the history
Fix the doctest error reported in
https://trac.sagemath.org/ticket/27480#comment:78 with a tolerance gap
{{{
**********************************************************************
File "src/sage/graphs/generic_graph.py", line 9663, in
sage.graphs.generic_graph.GenericGraph.?
Failed example:
    G.pagerank(alpha=0.50, algorithm="igraph")  # optional -
python_igraph
Expected:
    {0: 0.25, 1: 0.25, 2: 0.24999999999999997, 3: 0.24999999999999997}
Got:
    {0: 0.25, 1: 0.25, 2: 0.25, 3: 0.25}
**********************************************************************
1 item had failures:
   1 of 860 in sage.graphs.generic_graph.GenericGraph.?
    [3497 tests, 1 failure, 50.96 s]
----------------------------------------------------------------------
sage -t --long src/sage/graphs/generic_graph.py  # 1 doctest failed
}}}

URL: https://trac.sagemath.org/27811
Reported by: dcoudert
Ticket author(s): David Coudert
Reviewer(s): Frédéric Chapoton
  • Loading branch information
Release Manager authored and vbraun committed May 20, 2019
2 parents f655716 + 2422888 commit 925119d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9660,8 +9660,8 @@ def pagerank(self, alpha=0.85, personalization=None, by_weight=False,
sage: G = graphs.CycleGraph(4)
sage: G.pagerank(algorithm="Networkx")
{0: 0.25, 1: 0.25, 2: 0.25, 3: 0.25}
sage: G.pagerank(alpha=0.50, algorithm="igraph") # optional - python_igraph
{0: 0.25, 1: 0.25, 2: 0.24999999999999997, 3: 0.24999999999999997}
sage: G.pagerank(alpha=0.50, algorithm="igraph") # optional - python_igraph # abs tol 1e-9
{0: 0.25, 1: 0.25, 2: 0.25, 3: 0.25}
sage: G = Graph([(1, 2, 40), (2, 3, 50), (3, 4, 60), (1, 4, 70), (4, 5, 80), (5, 6, 20)])
sage: G.pagerank(algorithm="NetworkX") # abs tol 1e-9
{1: 0.16112205885619568,
Expand Down

0 comments on commit 925119d

Please sign in to comment.