Skip to content

Commit 8153dbd

Browse files
author
Matthias Koeppe
committed
sage.combinat.words: More block tags
1 parent 6613b17 commit 8153dbd

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

src/sage/combinat/words/finite_word.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6824,18 +6824,19 @@ def colored_vector(self, x=0, y=0, width='default', height=1, cmap='hsv', thickn
68246824
68256825
EXAMPLES::
68266826
6827-
sage: Word(range(20)).colored_vector() # needs sage.plot
6827+
sage: # needs sage.plot
6828+
sage: Word(range(20)).colored_vector()
68286829
Graphics object consisting of 21 graphics primitives
6829-
sage: Word(range(100)).colored_vector(0,0,10,1) # needs sage.plot
6830+
sage: Word(range(100)).colored_vector(0,0,10,1)
68306831
Graphics object consisting of 101 graphics primitives
6831-
sage: Words(range(100))(range(10)).colored_vector() # needs sage.plot
6832+
sage: Words(range(100))(range(10)).colored_vector()
68326833
Graphics object consisting of 11 graphics primitives
68336834
sage: w = Word('abbabaab')
6834-
sage: w.colored_vector() # needs sage.plot
6835+
sage: w.colored_vector()
68356836
Graphics object consisting of 9 graphics primitives
6836-
sage: w.colored_vector(cmap='autumn') # needs sage.plot
6837+
sage: w.colored_vector(cmap='autumn')
68376838
Graphics object consisting of 9 graphics primitives
6838-
sage: Word(range(20)).colored_vector(label='Rainbow') # needs sage.plot
6839+
sage: Word(range(20)).colored_vector(label='Rainbow')
68396840
Graphics object consisting of 23 graphics primitives
68406841
68416842
When two words are defined under the same parent, same letters are

src/sage/combinat/words/morphism.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def __init__(self, data, domain=None, codomain=None):
346346
The image of a letter can be a set, but the order is not
347347
preserved::
348348
349-
sage: WordMorphism({2:[4,5,6],3:set([4,1,8])}) #random results
349+
sage: WordMorphism({2:[4,5,6],3:set([4,1,8])}) # random results
350350
WordMorphism: 2->456, 3->814
351351
352352
If the image of a letter is not iterable, it is considered as a
@@ -1099,23 +1099,24 @@ def _matrix_(self, R=None):
10991099
11001100
EXAMPLES::
11011101
1102+
sage: # needs sage.modules
11021103
sage: fibo = WordMorphism('a->ab,b->a')
11031104
sage: tm = WordMorphism('a->ab,b->ba')
1104-
sage: Mfibo = matrix(fibo); Mfibo # indirect doctest # needs sage.modules
1105+
sage: Mfibo = matrix(fibo); Mfibo # indirect doctest
11051106
[1 1]
11061107
[1 0]
1107-
sage: Mtm = matrix(tm); Mtm # needs sage.modules
1108+
sage: Mtm = matrix(tm); Mtm
11081109
[1 1]
11091110
[1 1]
1110-
sage: Mtm * Mfibo == matrix(tm*fibo) # indirect doctest # needs sage.modules
1111+
sage: Mtm * Mfibo == matrix(tm*fibo) # indirect doctest
11111112
True
1112-
sage: Mfibo * Mtm == matrix(fibo*tm) # indirect doctest # needs sage.modules
1113+
sage: Mfibo * Mtm == matrix(fibo*tm) # indirect doctest
11131114
True
1114-
sage: Mfibo.parent() # needs sage.modules
1115+
sage: Mfibo.parent()
11151116
Full MatrixSpace of 2 by 2 dense matrices over Integer Ring
1116-
sage: p = Mfibo.charpoly(); p # needs sage.modules
1117+
sage: p = Mfibo.charpoly(); p
11171118
x^2 - x - 1
1118-
sage: p.roots(ring=RR, multiplicities=False) # needs sage.modules
1119+
sage: p.roots(ring=RR, multiplicities=False)
11191120
[-0.618033988749895, 1.61803398874989]
11201121
"""
11211122
if R is None:
@@ -1406,19 +1407,19 @@ def partition_of_domain_alphabet(self):
14061407
EXAMPLES::
14071408
14081409
sage: m = WordMorphism('a->b,b->a')
1409-
sage: m.partition_of_domain_alphabet() #random ordering
1410+
sage: m.partition_of_domain_alphabet() # random ordering
14101411
({'a'}, {'b'}, {})
14111412
sage: m = WordMorphism('a->b,b->a,c->c')
1412-
sage: m.partition_of_domain_alphabet() #random ordering
1413+
sage: m.partition_of_domain_alphabet() # random ordering
14131414
({'a'}, {'b'}, {'c'})
14141415
sage: m = WordMorphism('a->a,b->b,c->c')
1415-
sage: m.partition_of_domain_alphabet() #random ordering
1416+
sage: m.partition_of_domain_alphabet() # random ordering
14161417
({}, {}, {'a', 'c', 'b'})
14171418
sage: m = WordMorphism('A->T,T->A,C->G,G->C')
1418-
sage: m.partition_of_domain_alphabet() #random ordering
1419+
sage: m.partition_of_domain_alphabet() # random ordering
14191420
({'A', 'C'}, {'T', 'G'}, {})
14201421
sage: I = WordMorphism({0:oo,oo:0,1:-1,-1:1,2:-2,-2:2,3:-3,-3:3})
1421-
sage: I.partition_of_domain_alphabet() #random ordering
1422+
sage: I.partition_of_domain_alphabet() # random ordering
14221423
({0, -1, -3, -2}, {1, 2, 3, +Infinity}, {})
14231424
14241425
TESTS::

0 commit comments

Comments
 (0)