Skip to content

Commit 21e8f9f

Browse files
author
Release Manager
committed
gh-35647: sage.graphs: More # optional and other modularization fixes
<!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> Part of: - #29705 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [ ] 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: #35647 Reported by: Matthias Köppe Reviewer(s): David Coudert
2 parents 3b9d676 + 979420d commit 21e8f9f

25 files changed

+479
-432
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=e55fd192510499ab59847906bf0abc0e1776aecb
3-
md5=7adfc7ea92837b419c9cf91085b4c0c2
4-
cksum=2479564476
2+
sha1=1ef3ccb4e221787756f5d865edd4883d6e8a2aab
3+
md5=f7ca42afb156ba5aa99de96f825948b7
4+
cksum=3849472062
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8455792fc708dc9b848e9d084e96a6a890bca822
1+
111d02b0cbc6552b1650930728c7084a72f88a73

src/sage/graphs/base/c_graph.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4548,7 +4548,7 @@ cdef class CGraphBackend(GenericGraphBackend):
45484548
At first, the following graph is acyclic::
45494549
45504550
sage: D = DiGraph({ 0:[1,2,3], 4:[2,5], 1:[8], 2:[7], 3:[7], 5:[6,7], 7:[8], 6:[9], 8:[10], 9:[10] })
4551-
sage: D.plot(layout='circular').show()
4551+
sage: D.plot(layout='circular').show() # optional - sage.plot
45524552
sage: D.is_directed_acyclic()
45534553
True
45544554

src/sage/graphs/bipartite_graph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class BipartiteGraph(Graph):
158158
sage: B = BipartiteGraph(P, partition, check=False)
159159
sage: B.left
160160
{0, 1, 2, 3, 4}
161-
sage: B.show()
161+
sage: B.show() # optional - sage.plot
162162
163163
::
164164
@@ -304,14 +304,14 @@ class BipartiteGraph(Graph):
304304
sage: B = BipartiteGraph('F?^T_\n', partition=[[0, 1, 2], [3, 4, 5, 6]], check=False)
305305
sage: B.left
306306
{0, 1, 2}
307-
sage: B.show()
307+
sage: B.show() # optional - sage.plot
308308
309309
#. From a NetworkX bipartite graph::
310310
311-
sage: import networkx # optional - networkx
312-
sage: G = graphs.OctahedralGraph() # optional - networkx
313-
sage: N = networkx.make_clique_bipartite(G.networkx_graph()) # optional - networkx
314-
sage: B = BipartiteGraph(N) # optional - networkx
311+
sage: import networkx # optional - networkx
312+
sage: G = graphs.OctahedralGraph() # optional - networkx
313+
sage: N = networkx.make_clique_bipartite(G.networkx_graph()) # optional - networkx
314+
sage: B = BipartiteGraph(N) # optional - networkx
315315
316316
TESTS:
317317
@@ -1464,7 +1464,7 @@ def plot(self, *args, **kwds):
14641464
EXAMPLES::
14651465
14661466
sage: B = BipartiteGraph(graphs.CycleGraph(20))
1467-
sage: B.plot()
1467+
sage: B.plot() # optional - sage.plot
14681468
Graphics object consisting of 41 graphics primitives
14691469
"""
14701470
if "pos" not in kwds:

src/sage/graphs/cliquer.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def all_max_clique(graph):
115115
[2, 6], [2, 8], [3, 4], [3, 7], [3, 9], [4, 5], [4, 8], [5, 10],
116116
[5, 11], [6, 10], [6, 11], [7, 8], [7, 11], [8, 10], [9, 10], [9, 11]]
117117
sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
118-
sage: G.show(figsize=[2,2])
118+
sage: G.show(figsize=[2,2]) # optional - sage.plot
119119
sage: G.cliques_maximum()
120120
[[0, 1, 2], [0, 1, 3]]
121121
sage: C = graphs.PetersenGraph()
@@ -302,7 +302,7 @@ def clique_number(graph):
302302
sage: C.clique_number()
303303
4
304304
sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
305-
sage: G.show(figsize=[2,2])
305+
sage: G.show(figsize=[2,2]) # optional - sage.plot
306306
sage: G.clique_number()
307307
3
308308

src/sage/graphs/comparability.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def is_permutation(g, algorithm="greedy", certificate=False, check=True,
642642
sage: p1 = Permutation([nn+1 for nn in perm[0]])
643643
sage: p2 = Permutation([nn+1 for nn in perm[1]])
644644
sage: p = p2 * p1.inverse()
645-
sage: p.show(representation = "braid")
645+
sage: p.show(representation="braid") # optional - sage.plot
646646

647647
TESTS:
648648

src/sage/graphs/connectivity.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def connected_components_subgraphs(G):
215215
sage: from sage.graphs.connectivity import connected_components_subgraphs
216216
sage: G = Graph({0: [1, 3], 1: [2], 2: [3], 4: [5, 6], 5: [6]})
217217
sage: L = connected_components_subgraphs(G)
218-
sage: graphs_list.show_graphs(L)
218+
sage: graphs_list.show_graphs(L) # optional - sage.plot
219219
sage: D = DiGraph({0: [1, 3], 1: [2], 2: [3], 4: [5, 6], 5: [6]})
220220
sage: L = connected_components_subgraphs(D)
221-
sage: graphs_list.show_graphs(L)
221+
sage: graphs_list.show_graphs(L) # optional - sage.plot
222222
sage: L = D.connected_components_subgraphs()
223-
sage: graphs_list.show_graphs(L)
223+
sage: graphs_list.show_graphs(L) # optional - sage.plot
224224
225225
TESTS:
226226

src/sage/graphs/digraph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def is_directed_acyclic(self, certificate=False):
951951
At first, the following graph is acyclic::
952952
953953
sage: D = DiGraph({0:[1, 2, 3], 4:[2, 5], 1:[8], 2:[7], 3:[7], 5:[6,7], 7:[8], 6:[9], 8:[10], 9:[10]})
954-
sage: D.plot(layout='circular').show()
954+
sage: D.plot(layout='circular').show() # optional - sage.plot
955955
sage: D.is_directed_acyclic()
956956
True
957957
@@ -3140,7 +3140,7 @@ def topological_sort(self, implementation="default"):
31403140
31413141
sage: D = DiGraph({0: [1, 2, 3], 4: [2, 5], 1: [8], 2: [7], 3: [7],
31423142
....: 5: [6, 7], 7: [8], 6: [9], 8: [10], 9: [10]})
3143-
sage: D.plot(layout='circular').show()
3143+
sage: D.plot(layout='circular').show() # optional - sage.plot
31443144
sage: D.topological_sort()
31453145
[4, 5, 6, 9, 0, 1, 2, 3, 7, 8, 10]
31463146
@@ -3220,7 +3220,7 @@ def topological_sort_generator(self):
32203220
EXAMPLES::
32213221
32223222
sage: D = DiGraph({0: [1, 2], 1: [3], 2: [3, 4]})
3223-
sage: D.plot(layout='circular').show()
3223+
sage: D.plot(layout='circular').show() # optional - sage.plot
32243224
sage: list(D.topological_sort_generator())
32253225
[[0, 1, 2, 3, 4], [0, 2, 1, 3, 4], [0, 2, 1, 4, 3], [0, 2, 4, 1, 3], [0, 1, 2, 4, 3]]
32263226

0 commit comments

Comments
 (0)