Skip to content

Commit 50208b7

Browse files
author
Release Manager
committed
gh-36077: sage.graphs: fix doctest warnings due to modularization
Part of : #29705 We fix the following doctest warnings due to the modularization. ``` sage -t --warn-long 17.6 --random- seed=165655739949225352692057073882229651510 src/sage/graphs/generators/distance_regular.pyx ********************************************************************** File "src/sage/graphs/generators/distance_regular.pyx", line 1761, in sage.graphs.generators.distance_regular._line_graph_generalised_polygon Warning: Variable '_line_graph_generalised_polygon' referenced here was set only in doctest marked '# needs sage.libs.gap' H = _line_graph_generalised_polygon(G) [181 tests, 7.59 s] ``` ``` sage -t --warn-long 17.6 --random- seed=165655739949225352692057073882229651510 src/sage/graphs/generators/families.py ********************************************************************** File "src/sage/graphs/generators/families.py", line 3943, in sage.graphs.generators.families.MathonPseudocyclicStronglyRegularGraph Warning: Variable 'G3x3' referenced here was set only in doctest marked '# needs sage.groups sage.libs.gap sage.modules sage.rings.finite_rings' G3x3.is_strongly_regular(parameters=True) ********************************************************************** File "src/sage/graphs/generators/families.py", line 3945, in sage.graphs.generators.families.MathonPseudocyclicStronglyRegularGraph Warning: Variable 'G3x3' referenced here was set only in doctest marked '# needs sage.groups sage.libs.gap sage.modules sage.rings.finite_rings' G3x3.automorphism_group(algorithm="bliss").order() # optional - bliss [449 tests, 4.75 s] ``` ``` sage -t --warn-long 17.6 --random- seed=165655739949225352692057073882229651510 src/sage/graphs/graph_decompositions/tdlib.pyx ********************************************************************** File "src/sage/graphs/graph_decompositions/tdlib.pyx", line 128, in sage.graphs.graph_decompositions.tdlib.treedecomposition_exact Warning: Consider using a block-scoped tag by inserting the line 'sage: # optional - tdlib' just before this line to avoid repeating the tag 4 times import sage.graphs.graph_decompositions.tdlib as tdlib # optional - tdlib ********************************************************************** File "src/sage/graphs/graph_decompositions/tdlib.pyx", line 179, in sage.graphs.graph_decompositions.tdlib.get_width Warning: Consider using a block-scoped tag by inserting the line 'sage: # optional - tdlib' just before this line to avoid repeating the tag 4 times import sage.graphs.graph_decompositions.tdlib as tdlib # optional - tdlib [13 tests, 0.60 s] ``` ``` sage -t --warn-long 17.6 --random- seed=165655739949225352692057073882229651510 src/sage/graphs/base/static_sparse_graph.pyx ********************************************************************** File "src/sage/graphs/base/static_sparse_graph.pyx", line 1044, in sage.graphs.base.static_sparse_graph.spectral_radius Warning: Variable 'r' referenced here was set only in doctest marked '# needs sage.modules' e_min < r < e_max [66 tests, 2.16 s] ``` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36077 Reported by: David Coudert Reviewer(s): Matthias Köppe
2 parents 2b22924 + 0670be0 commit 50208b7

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=0c03cb79520ba7f484e811aeb10ce528b3ea97d5
3-
md5=499635417f054c55dc90c9aca9494d61
4-
cksum=3916950255
2+
sha1=ea8ea50e414e3ccd69a959f9dff3e33adbdf4370
3+
md5=b31958a145813f26867b39c377e12936
4+
cksum=2139568085
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ffdd9f8e55c138555338187b059d80ceecc2abaf
1+
6c72c2b94a98cfdb5730473e5e2f9eb15cf5d8f3

src/sage/graphs/base/static_sparse_graph.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,15 +1032,16 @@ def spectral_radius(G, prec=1e-10):
10321032
10331033
A larger example::
10341034
1035+
sage: # needs sage.modules
10351036
sage: G = DiGraph()
10361037
sage: G.add_edges((i,i+1) for i in range(200))
10371038
sage: G.add_edge(200,0)
10381039
sage: G.add_edge(1,0)
10391040
sage: e_min, e_max = spectral_radius(G, 0.00001)
1040-
sage: p = G.adjacency_matrix(sparse=True).charpoly() # needs sage.modules
1041-
sage: p # needs sage.modules
1041+
sage: p = G.adjacency_matrix(sparse=True).charpoly()
1042+
sage: p
10421043
x^201 - x^199 - 1
1043-
sage: r = p.roots(AA, multiplicities=False)[0] # needs sage.modules
1044+
sage: r = p.roots(AA, multiplicities=False)[0]
10441045
sage: e_min < r < e_max
10451046
True
10461047

src/sage/graphs/generators/distance_regular.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,8 +1755,8 @@ def _line_graph_generalised_polygon(H):
17551755
EXAMPLES::
17561756
17571757
sage: # needs sage.libs.gap
1758-
sage: from sage.graphs.generators.distance_regular import \
1759-
....: _line_graph_generalised_polygon
1758+
sage: from sage.graphs.generators.distance_regular import (
1759+
....: _line_graph_generalised_polygon)
17601760
sage: G = graphs.GeneralisedHexagonGraph(1, 8)
17611761
sage: H = _line_graph_generalised_polygon(G)
17621762
sage: H.is_distance_regular(True)

src/sage/graphs/generators/families.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3937,12 +3937,12 @@ def MathonPseudocyclicStronglyRegularGraph(t, G=None, L=None):
39373937
[-4 -3 -2 2 3 4 -1 0 1]
39383938
[-2 -4 -3 4 2 3 1 -1 0]
39393939
3940-
sage: # needs sage.modules sage.rings.finite_rings
3940+
sage: # needs sage.modules sage.rings.finite_rings sage.groups sage.libs.gap
39413941
sage: G.relabel(range(9))
3942-
sage: G3x3 = graphs.MathonPseudocyclicStronglyRegularGraph(2, G=G, L=L) # needs sage.groups sage.libs.gap
3942+
sage: G3x3 = graphs.MathonPseudocyclicStronglyRegularGraph(2, G=G, L=L)
39433943
sage: G3x3.is_strongly_regular(parameters=True)
39443944
(441, 220, 109, 110)
3945-
sage: G3x3.automorphism_group(algorithm="bliss").order() # optional - bliss
3945+
sage: G3x3.automorphism_group(algorithm="bliss").order() # optional - bliss
39463946
27
39473947
sage: G9 = graphs.MathonPseudocyclicStronglyRegularGraph(2)
39483948
sage: G9.is_strongly_regular(parameters=True)

src/sage/graphs/graph_decompositions/tdlib.pyx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ def treedecomposition_exact(G, lb=-1):
125125
126126
EXAMPLES::
127127
128-
sage: import sage.graphs.graph_decompositions.tdlib as tdlib # optional - tdlib
129-
sage: G = graphs.HouseGraph() # optional - tdlib
130-
sage: T = tdlib.treedecomposition_exact(G) # optional - tdlib
131-
sage: T.show(vertex_size=2000) # optional - tdlib
128+
sage: # optional - tdlib
129+
sage: import sage.graphs.graph_decompositions.tdlib as tdlib
130+
sage: G = graphs.HouseGraph()
131+
sage: T = tdlib.treedecomposition_exact(G)
132+
sage: T.show(vertex_size=2000)
132133
133134
TESTS::
134135
@@ -176,10 +177,11 @@ def get_width(T):
176177
177178
EXAMPLES::
178179
179-
sage: import sage.graphs.graph_decompositions.tdlib as tdlib # optional - tdlib
180-
sage: G = graphs.PetersenGraph() # optional - tdlib
181-
sage: T = tdlib.treedecomposition_exact(G) # optional - tdlib
182-
sage: tdlib.get_width(T) # optional - tdlib
180+
sage: # optional - tdlib
181+
sage: import sage.graphs.graph_decompositions.tdlib as tdlib
182+
sage: G = graphs.PetersenGraph()
183+
sage: T = tdlib.treedecomposition_exact(G)
184+
sage: tdlib.get_width(T)
183185
4
184186
"""
185187
return (max(len(x) for x in T) - 1) if T else -1

0 commit comments

Comments
 (0)