Skip to content

Commit 8ab391c

Browse files
author
Matthias Koeppe
committed
sage.typeset: More # optional
1 parent 0fd5967 commit 8ab391c

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

src/sage/typeset/ascii_art.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def ascii_art(*obj, **kwds):
255255
an ascii art separator::
256256
257257
sage: sep_line = ascii_art('\n'.join(' | ' for _ in range(6)), baseline=6)
258-
sage: ascii_art(*Partitions(6), separator=sep_line, sep_baseline=0)
258+
sage: ascii_art(*Partitions(6), separator=sep_line, sep_baseline=0) # optional - sage.combinat
259259
| | | | | | | | | | *
260260
| | | | | | | | | ** | *
261261
| | | | | | *** | | ** | * | *

src/sage/typeset/character_art_factory.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ def build(self, obj, baseline=None):
8484
8585
EXAMPLES::
8686
87-
sage: result = ascii_art(integral(exp(x+x^2)/(x+1), x))
87+
sage: result = ascii_art(integral(exp(x+x^2)/(x+1), x)) # optional - sage.symbolic
8888
...
89-
sage: result
89+
sage: result # optional - sage.symbolic
9090
/
9191
|
9292
| 2
@@ -99,8 +99,8 @@ def build(self, obj, baseline=None):
9999
100100
TESTS::
101101
102-
sage: n = var('n')
103-
sage: ascii_art(sum(binomial(2 * n, n + 1) * x^n, n, 0, oo))
102+
sage: n = var('n') # optional - sage.symbolic
103+
sage: ascii_art(sum(binomial(2 * n, n + 1) * x^n, n, 0, oo)) # optional - sage.symbolic
104104
/ _________ \
105105
-\2*x + \/ 1 - 4*x - 1/
106106
-------------------------
@@ -161,10 +161,10 @@ def build_from_magic_method(self, obj, baseline=None):
161161
EXAMPLES::
162162
163163
sage: from sage.typeset.ascii_art import _ascii_art_factory as factory
164-
sage: out = factory.build_from_magic_method(identity_matrix(2)); out
164+
sage: out = factory.build_from_magic_method(identity_matrix(2)); out # optional - sage.modules
165165
[1 0]
166166
[0 1]
167-
sage: type(out)
167+
sage: type(out) # optional - sage.modules
168168
<class 'sage.typeset.ascii_art.AsciiArt'>
169169
"""
170170
magic_method = getattr(obj, self.magic_method_name)
@@ -243,12 +243,12 @@ def build_container(self, content, left_border, right_border, baseline=0):
243243
244244
TESTS::
245245
246-
sage: l = ascii_art(list(DyckWords(3))) # indirect doctest
247-
sage: l
246+
sage: l = ascii_art(list(DyckWords(3))) # indirect doctest # optional - sage.combinat
247+
sage: l # optional - sage.combinat
248248
[ /\ ]
249249
[ /\ /\ /\/\ / \ ]
250250
[ /\/\/\, /\/ \, / \/\, / \, / \ ]
251-
sage: l._breakpoints
251+
sage: l._breakpoints # optional - sage.combinat
252252
[9, 17, 25, 33]
253253
254254
Check that zero-height strings are handled (:trac:`28527`)::
@@ -289,7 +289,7 @@ def build_set(self, s, baseline=0):
289289
iteration over sets is non-deterministic so too is the results of this
290290
test::
291291
292-
sage: ascii_art(set(DyckWords(3))) # indirect doctest random
292+
sage: ascii_art(set(DyckWords(3))) # indirect doctest random # optional - sage.combinat
293293
{ /\ }
294294
{ /\ /\/\ /\ / \ }
295295
{ / \/\, / \, /\/\/\, /\/ \, / \ }
@@ -298,7 +298,7 @@ def build_set(self, s, baseline=0):
298298
a set, but still obtain the same output formatting::
299299
300300
sage: from sage.typeset.ascii_art import _ascii_art_factory as factory
301-
sage: factory.build_set(sorted(set(DyckWords(3))))
301+
sage: factory.build_set(sorted(set(DyckWords(3)))) # optional - sage.combinat
302302
{ /\ }
303303
{ /\ /\ /\/\ / \ }
304304
{ /\/\/\, /\/ \, / \/\, / \, / \ }
@@ -316,13 +316,13 @@ def build_dict(self, d, baseline=0):
316316
TESTS::
317317
318318
sage: from collections import OrderedDict
319-
sage: d = OrderedDict(enumerate(DyckWords(3)))
320-
sage: art = ascii_art(d) # indirect doctest
321-
sage: art
319+
sage: d = OrderedDict(enumerate(DyckWords(3))) # optional - sage.combinat
320+
sage: art = ascii_art(d) # indirect doctest # optional - sage.combinat
321+
sage: art # optional - sage.combinat
322322
{ /\ }
323323
{ /\ /\ /\/\ / \ }
324324
{ 0:/\/\/\, 1:/\/ \, 2:/ \/\, 3:/ \, 4:/ \ }
325-
sage: art._breakpoints
325+
sage: art._breakpoints # optional - sage.combinat
326326
[11, 21, 31, 41]
327327
328328
Check that :trac:`29447` is fixed::
@@ -357,18 +357,18 @@ def build_list(self, l, baseline=0):
357357
358358
TESTS::
359359
360-
sage: l = ascii_art(list(DyckWords(3))) # indirect doctest
361-
sage: l
360+
sage: l = ascii_art(list(DyckWords(3))) # indirect doctest # optional - sage.combinat
361+
sage: l # optional - sage.combinat
362362
[ /\ ]
363363
[ /\ /\ /\/\ / \ ]
364364
[ /\/\/\, /\/ \, / \/\, / \, / \ ]
365-
sage: l._breakpoints
365+
sage: l._breakpoints # optional - sage.combinat
366366
[9, 17, 25, 33]
367367
368368
The breakpoints of the object are used as breakpoints::
369369
370-
sage: l = ascii_art([DyckWords(2).list(), DyckWords(2).list()])
371-
sage: l._breakpoints
370+
sage: l = ascii_art([DyckWords(2).list(), DyckWords(2).list()]) # optional - sage.combinat
371+
sage: l._breakpoints # optional - sage.combinat
372372
[(2, [7]), 17, (18, [7])]
373373
374374
The parentheses only stretch as high as the content (:trac:`28527`)::
@@ -399,7 +399,7 @@ def build_tuple(self, t, baseline=0):
399399
400400
TESTS::
401401
402-
sage: ascii_art(tuple(DyckWords(3))) # indirect doctest
402+
sage: ascii_art(tuple(DyckWords(3))) # indirect doctest # optional - sage.combinat
403403
( /\ )
404404
( /\ /\ /\/\ / \ )
405405
( /\/\/\, /\/ \, / \/\, / \, / \ )
@@ -440,8 +440,8 @@ def concatenate(self, iterable, separator, empty=None, baseline=0,
440440
441441
EXAMPLES::
442442
443-
sage: i2 = identity_matrix(2)
444-
sage: ascii_art(i2, i2, i2, sep=ascii_art(1/x))
443+
sage: i2 = identity_matrix(2) # optional - sage.modules
444+
sage: ascii_art(i2, i2, i2, sep=ascii_art(1/x)) # optional - sage.modules
445445
1 1
446446
[1 0]-[1 0]-[1 0]
447447
[0 1]x[0 1]x[0 1]

src/sage/typeset/unicode_art.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def unicode_art(*obj, **kwds):
107107
an unicode art separator::
108108
109109
sage: sep_line = unicode_art('\n'.join(' ⎟ ' for _ in range(5)), baseline=5)
110-
sage: unicode_art(*AlternatingSignMatrices(3),
110+
sage: unicode_art(*AlternatingSignMatrices(3), # optional - sage.combinat
111111
....: separator=sep_line, sep_baseline=1)
112112
⎟ ⎟ ⎟ ⎟ ⎟ ⎟
113113
⎛1 0 0⎞ ⎟ ⎛0 1 0⎞ ⎟ ⎛1 0 0⎞ ⎟ ⎛ 0 1 0⎞ ⎟ ⎛0 0 1⎞ ⎟ ⎛0 1 0⎞ ⎟ ⎛0 0 1⎞

0 commit comments

Comments
 (0)