Skip to content

Commit 0598885

Browse files
author
Matthias Koeppe
committed
sage.combinat: More # optional
1 parent 6fd4a5c commit 0598885

File tree

6 files changed

+43
-40
lines changed

6 files changed

+43
-40
lines changed

src/sage/combinat/cluster_algebra_quiver/cluster_seed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# sage.doctest - sage.graphs sage.modules
22
r"""
33
ClusterSeed
44

src/sage/combinat/cluster_algebra_quiver/interact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def cluster_interact(self, fig_size=1, circular=True, kind='seed'):
2525
2626
TESTS::
2727
28-
sage: S = ClusterSeed(['A',4]) # optional - sage.graphs
29-
sage: S.interact() # indirect doctest # optional - sage.graphs sage.symbolic
28+
sage: S = ClusterSeed(['A',4]) # optional - sage.graphs sage.modules
29+
sage: S.interact() # indirect doctest # optional - sage.graphs sage.modules sage.symbolic
3030
...VBox(children=...
3131
"""
3232
if kind not in ['seed', 'quiver']:

src/sage/combinat/cluster_algebra_quiver/mutation_class.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# sage.doctest: optional - sage.graphs
12
r"""
23
mutation_class
34
@@ -41,11 +42,11 @@ def _principal_part(mat):
4142
EXAMPLES::
4243
4344
sage: from sage.combinat.cluster_algebra_quiver.mutation_class import _principal_part
44-
sage: M = Matrix([[1,2],[3,4],[5,6]]); M
45+
sage: M = Matrix([[1,2],[3,4],[5,6]]); M # optional - sage.modules
4546
[1 2]
4647
[3 4]
4748
[5 6]
48-
sage: _principal_part(M)
49+
sage: _principal_part(M) # optional - sage.modules
4950
[1 2]
5051
[3 4]
5152
"""
@@ -159,7 +160,7 @@ def _matrix_to_digraph( M ):
159160
EXAMPLES::
160161
161162
sage: from sage.combinat.cluster_algebra_quiver.mutation_class import _matrix_to_digraph
162-
sage: _matrix_to_digraph(matrix(3,[0,1,0,-1,0,-1,0,1,0]))
163+
sage: _matrix_to_digraph(matrix(3,[0,1,0,-1,0,-1,0,1,0])) # optional - sage.modules
163164
Digraph on 3 vertices
164165
"""
165166
n = M.ncols()
@@ -452,7 +453,7 @@ def _dig6_to_matrix( dig6 ):
452453
sage: from sage.combinat.cluster_algebra_quiver.quiver import ClusterQuiver
453454
sage: dg = ClusterQuiver(['A',4]).digraph()
454455
sage: data = _digraph_to_dig6(dg)
455-
sage: _dig6_to_matrix(data)
456+
sage: _dig6_to_matrix(data) # optional - sage.modules
456457
[ 0 1 0 0]
457458
[-1 0 -1 0]
458459
[ 0 1 0 1]

src/sage/combinat/cluster_algebra_quiver/mutation_type.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# sage.doctest: optional - sage.graphs
12
r"""
23
Helper functions for mutation types of quivers
34
@@ -55,20 +56,20 @@ def is_mutation_finite(M, nr_of_checks=None):
5556
sage: from sage.combinat.cluster_algebra_quiver.mutation_type import is_mutation_finite
5657
5758
sage: Q = ClusterQuiver(['A',10])
58-
sage: M = Q.b_matrix()
59-
sage: is_mutation_finite(M)
59+
sage: M = Q.b_matrix() # optional - sage.modules
60+
sage: is_mutation_finite(M) # optional - sage.modules
6061
(True, None)
6162
6263
sage: Q = ClusterQuiver([(0,1),(1,2),(2,3),(3,4),(4,5),(5,6),(6,7),(7,8),(2,9)])
63-
sage: M = Q.b_matrix()
64-
sage: is_mutation_finite(M) # random
64+
sage: M = Q.b_matrix() # optional - sage.modules
65+
sage: is_mutation_finite(M) # random # optional - sage.modules
6566
(False, [9, 6, 9, 8, 9, 4, 0, 4, 5, 2, 1, 0, 1, 0, 7, 1, 9, 2, 5, 7, 8, 6, 3, 0, 2, 5, 4, 2, 6, 9, 2, 7, 3, 5, 3, 7, 9, 5, 9, 0, 2, 7, 9, 2, 4, 2, 1, 6, 9, 4, 3, 5, 0, 8, 2, 9, 5, 3, 7, 0, 1, 8, 3, 7, 2, 7, 3, 4, 8, 0, 4, 9, 5, 2, 8, 4, 8, 1, 7, 8, 9, 1, 5, 0, 8, 7, 4, 8, 9, 8, 0, 7, 4, 7, 1, 2, 8, 6, 1, 3, 9, 3, 9, 1, 3, 2, 4, 9, 5, 1, 2, 9, 4, 8, 5, 3, 4, 6, 8, 9, 2, 5, 9, 4, 6, 2, 1, 4, 9, 6, 0, 9, 8, 0, 4, 7, 9, 2, 1, 6])
6667
6768
Check that :trac:`19495` is fixed::
6869
69-
sage: dg = DiGraph(); dg.add_vertex(0); S = ClusterSeed(dg); S
70+
sage: dg = DiGraph(); dg.add_vertex(0); S = ClusterSeed(dg); S # optional - sage.modules
7071
A seed for a cluster algebra of rank 1
71-
sage: S.is_mutation_finite()
72+
sage: S.is_mutation_finite() # optional - sage.modules
7273
True
7374
"""
7475
import random
@@ -1428,7 +1429,7 @@ def _random_tests(mt, k, mut_class=None, nr_mut=5):
14281429
TESTS::
14291430
14301431
sage: from sage.combinat.cluster_algebra_quiver.mutation_type import _random_tests
1431-
sage: _random_tests( ['A',3], 1)
1432+
sage: _random_tests( ['A',3], 1) # optional - sage.modules
14321433
testing ['A', 3]
14331434
"""
14341435
from sage.combinat.cluster_algebra_quiver.quiver import ClusterQuiver

src/sage/combinat/cluster_algebra_quiver/quiver.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# sage.doctest: optional - sage.graphs sage.modules
22
r"""
33
Quiver
44
@@ -40,7 +40,6 @@
4040
from sage.structure.sage_object import SageObject
4141
from copy import copy
4242
from sage.rings.integer_ring import ZZ
43-
from sage.rings.cc import CC
4443
from sage.rings.infinity import infinity
4544
from sage.graphs.digraph import DiGraph
4645
from sage.graphs.graph import Graph
@@ -67,14 +66,14 @@ class ClusterQuiver(SageObject):
6766
6867
- ``data`` -- can be any of the following::
6968
70-
* QuiverMutationType
71-
* str - a string representing a QuiverMutationType or a common quiver type (see Examples)
72-
* ClusterQuiver
73-
* Matrix - a skew-symmetrizable matrix
74-
* DiGraph - must be the input data for a quiver
75-
* List of edges - must be the edge list of a digraph for a quiver
69+
* :class:`QuiverMutationType`
70+
* :class:`str` -- a string representing a :class:`QuiverMutationType` or a common quiver type (see Examples)
71+
* :class:`ClusterQuiver`
72+
* :class:`Matrix` -- a skew-symmetrizable matrix
73+
* :class:`DiGraph` -- must be the input data for a quiver
74+
* List of edges -- must be the edge list of a digraph for a quiver
7675
77-
- ``frozen`` -- (default:``None``) sets the list of frozen variables
76+
- ``frozen`` -- (default: ``None``) sets the list of frozen variables
7877
if the input type is a :class:`DiGraph`, it is ignored otherwise
7978
8079
- ``user_labels`` -- (default:``None``) sets the names of the labels for
@@ -559,6 +558,7 @@ def plot(self, circular=True, center=(0, 0), directed=True, mark=None,
559558
from sage.plot.colors import rainbow
560559
from sage.graphs.graph_generators import GraphGenerators
561560
from sage.symbolic.constants import e, pi
561+
from sage.rings.cc import CC
562562
from sage.rings.imaginary_unit import I
563563
graphs = GraphGenerators()
564564
# returns positions for graph vertices on two concentric cycles with radius 1 and 2

src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# sage.doctest: optional - sage.graphs
12
r"""
23
Quiver mutation types
34
@@ -326,7 +327,7 @@ def _samples(self):
326327
replacing all positive entries by their negatives and adding `2`'s on
327328
the main diagonal.
328329
329-
``QuiverMutationType`` constructs a quiver mutation type object. For
330+
:class:`QuiverMutationType` constructs a quiver mutation type object. For
330331
more detail on the possible different types, please see the
331332
compendium.
332333
@@ -708,7 +709,7 @@ def show(self, circular=False, directed=True):
708709
TESTS::
709710
710711
sage: QMT = QuiverMutationType(['A',5])
711-
sage: QMT.show() # long time
712+
sage: QMT.show() # long time # optional - sage.plot sage.symbolic
712713
"""
713714
self.plot(circular=circular, directed=directed).show()
714715

@@ -787,7 +788,7 @@ def b_matrix(self):
787788
788789
sage: mut_type = QuiverMutationType(['A',5]); mut_type
789790
['A', 5]
790-
sage: mut_type.b_matrix()
791+
sage: mut_type.b_matrix() # optional - sage.plot sage.symbolic
791792
[ 0 1 0 0 0]
792793
[-1 0 -1 0 0]
793794
[ 0 1 0 1 0]
@@ -796,7 +797,7 @@ def b_matrix(self):
796797
797798
sage: mut_type = QuiverMutationType(['A',3],['B',3]); mut_type
798799
[ ['A', 3], ['B', 3] ]
799-
sage: mut_type.b_matrix()
800+
sage: mut_type.b_matrix() # optional - sage.plot sage.symbolic
800801
[ 0 1 0 0 0 0]
801802
[-1 0 -1 0 0 0]
802803
[ 0 1 0 0 0 0]
@@ -853,7 +854,7 @@ def cartan_matrix(self):
853854
854855
sage: mut_type = QuiverMutationType(['A',5]); mut_type
855856
['A', 5]
856-
sage: mut_type.cartan_matrix()
857+
sage: mut_type.cartan_matrix() # optional - sage.modules
857858
[ 2 -1 0 0 0]
858859
[-1 2 -1 0 0]
859860
[ 0 -1 2 -1 0]
@@ -862,7 +863,7 @@ def cartan_matrix(self):
862863
863864
sage: mut_type = QuiverMutationType(['A',3],['B',3]); mut_type
864865
[ ['A', 3], ['B', 3] ]
865-
sage: mut_type.cartan_matrix()
866+
sage: mut_type.cartan_matrix() # optional - sage.modules
866867
[ 2 -1 0 0 0 0]
867868
[-1 2 -1 0 0 0]
868869
[ 0 -1 2 0 0 0]
@@ -1105,7 +1106,7 @@ def properties(self):
11051106
class QuiverMutationType_Irreducible(QuiverMutationType_abstract):
11061107
"""
11071108
The mutation type for a cluster algebra or a quiver. Should not be
1108-
called directly, but through QuiverMutationType.
1109+
called directly, but through :class:`QuiverMutationType`.
11091110
"""
11101111

11111112
def __init__(self, letter, rank, twist=None):
@@ -1694,7 +1695,7 @@ def class_size(self):
16941695
which are mutation equivalent to the standard quiver of
16951696
``self`` (up to isomorphism) is returned.
16961697
1697-
Otherwise, ``NotImplemented`` is returned.
1698+
Otherwise, :obj:`NotImplemented` is returned.
16981699
16991700
Formula for finite type A is taken from Torkildsen - Counting
17001701
cluster-tilted algebras of type `A_n`.
@@ -1898,7 +1899,7 @@ def class_size(self):
18981899

18991900
def dual(self):
19001901
"""
1901-
Return the QuiverMutationType which is dual to ``self``.
1902+
Return the :class:`QuiverMutationType` which is dual to ``self``.
19021903
19031904
EXAMPLES::
19041905
@@ -1962,8 +1963,8 @@ def dual(self):
19621963
class QuiverMutationType_Reducible(QuiverMutationType_abstract):
19631964
"""
19641965
The mutation type for a cluster algebra or a quiver. Should not be
1965-
called directly, but through QuiverMutationType. Inherits from
1966-
QuiverMutationType_abstract.
1966+
called directly, but through :class:`QuiverMutationType`. Inherits from
1967+
:class:`QuiverMutationType_abstract`.
19671968
"""
19681969

19691970
def __init__(self, *args):
@@ -2056,7 +2057,7 @@ def class_size(self):
20562057
which are mutation equivalent to the standard quiver of
20572058
``self`` (up to isomorphism) is returned.
20582059
2059-
Otherwise, ``NotImplemented`` is returned.
2060+
Otherwise, :obj:`NotImplemented` is returned.
20602061
20612062
EXAMPLES::
20622063
@@ -2095,7 +2096,7 @@ def class_size(self):
20952096

20962097
def dual(self):
20972098
"""
2098-
Return the QuiverMutationType which is dual to ``self``.
2099+
Return the :class:`QuiverMutationType` which is dual to ``self``.
20992100
21002101
EXAMPLES::
21012102
@@ -2296,7 +2297,7 @@ def save_quiver_data(n, up_to=True, types='ClassicalExceptional', verbose=True):
22962297
22972298
INPUT:
22982299
2299-
- ``n``: the rank (or the upper limit on the rank) of the mutation
2300+
- ``n`` -- the rank (or the upper limit on the rank) of the mutation
23002301
classes that are being saved.
23012302
23022303
- ``up_to`` -- (default:``True``) if ``True``, saves data for
@@ -2437,17 +2438,17 @@ def _edge_list_to_matrix(edges, nlist, mlist) -> matrix:
24372438
24382439
sage: from sage.combinat.cluster_algebra_quiver.quiver_mutation_type import _edge_list_to_matrix
24392440
sage: G = QuiverMutationType(['A', 2])._digraph
2440-
sage: _edge_list_to_matrix(G.edges(sort=True), [0, 1], [])
2441+
sage: _edge_list_to_matrix(G.edges(sort=True), [0, 1], []) # optional - sage.modules
24412442
[ 0 1]
24422443
[-1 0]
24432444
24442445
sage: G2 = DiGraph([('a', 'b', 1)])
2445-
sage: _edge_list_to_matrix(G2.edges(sort=True), ['a', 'b'], [])
2446+
sage: _edge_list_to_matrix(G2.edges(sort=True), ['a', 'b'], []) # optional - sage.modules
24462447
[ 0 1]
24472448
[-1 0]
24482449
24492450
sage: G3 = DiGraph([('a', 'b', 1), ('b', 'c', 1)])
2450-
sage: _edge_list_to_matrix(G3.edges(sort=True), ['a', 'b'], ['c'])
2451+
sage: _edge_list_to_matrix(G3.edges(sort=True), ['a', 'b'], ['c']) # optional - sage.modules
24512452
[ 0 1]
24522453
[-1 0]
24532454
[ 0 -1]

0 commit comments

Comments
 (0)