@@ -84,9 +84,9 @@ def build(self, obj, baseline=None):
84
84
85
85
EXAMPLES::
86
86
87
- sage: result = ascii_art(integral(exp(x+x^2)/(x+1), x)) # optional - sage.symbolic
87
+ sage: result = ascii_art(integral(exp(x+x^2)/(x+1), x)) # needs sage.symbolic
88
88
...
89
- sage: result # optional - sage.symbolic
89
+ sage: result # needs sage.symbolic
90
90
/
91
91
|
92
92
| 2
@@ -99,14 +99,14 @@ def build(self, obj, baseline=None):
99
99
100
100
TESTS::
101
101
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
102
+ sage: n = var('n') # needs sage.symbolic
103
+ sage: ascii_art(sum(binomial(2 * n, n + 1) * x^n, n, 0, oo)) # needs sage.symbolic
104
104
/ _________ \
105
105
-\2*x + \/ 1 - 4*x - 1/
106
106
-------------------------
107
107
_________
108
108
2*x*\/ 1 - 4*x
109
- sage: ascii_art(list(DyckWords(3))) # optional - sage.combinat
109
+ sage: ascii_art(list(DyckWords(3))) # needs sage.combinat
110
110
[ /\ ]
111
111
[ /\ /\ /\/\ / \ ]
112
112
[ /\/\/\, /\/ \, / \/\, / \, / \ ]
@@ -161,10 +161,10 @@ def build_from_magic_method(self, obj, baseline=None):
161
161
EXAMPLES::
162
162
163
163
sage: from sage.typeset.ascii_art import _ascii_art_factory as factory
164
- sage: out = factory.build_from_magic_method(identity_matrix(2)); out # optional - sage.modules
164
+ sage: out = factory.build_from_magic_method(identity_matrix(2)); out # needs sage.modules
165
165
[1 0]
166
166
[0 1]
167
- sage: type(out) # optional - sage.modules
167
+ sage: type(out) # needs sage.modules
168
168
<class 'sage.typeset.ascii_art.AsciiArt'>
169
169
"""
170
170
magic_method = getattr (obj , self .magic_method_name )
@@ -243,12 +243,12 @@ def build_container(self, content, left_border, right_border, baseline=0):
243
243
244
244
TESTS::
245
245
246
- sage: l = ascii_art(list(DyckWords(3))) # indirect doctest # optional - sage.combinat
247
- sage: l # optional - sage.combinat
246
+ sage: l = ascii_art(list(DyckWords(3))) # indirect doctest # needs sage.combinat
247
+ sage: l # needs sage.combinat
248
248
[ /\ ]
249
249
[ /\ /\ /\/\ / \ ]
250
250
[ /\/\/\, /\/ \, / \/\, / \, / \ ]
251
- sage: l._breakpoints # optional - sage.combinat
251
+ sage: l._breakpoints # needs sage.combinat
252
252
[9, 17, 25, 33]
253
253
254
254
Check that zero-height strings are handled (:trac:`28527`)::
@@ -289,7 +289,7 @@ def build_set(self, s, baseline=0):
289
289
iteration over sets is non-deterministic so too is the results of this
290
290
test::
291
291
292
- sage: ascii_art(set(DyckWords(3))) # indirect doctest random # optional - sage.combinat
292
+ sage: ascii_art(set(DyckWords(3))) # indirect doctest random # needs sage.combinat
293
293
{ /\ }
294
294
{ /\ /\/\ /\ / \ }
295
295
{ / \/\, / \, /\/\/\, /\/ \, / \ }
@@ -298,7 +298,7 @@ def build_set(self, s, baseline=0):
298
298
a set, but still obtain the same output formatting::
299
299
300
300
sage: from sage.typeset.ascii_art import _ascii_art_factory as factory
301
- sage: factory.build_set(sorted(set(DyckWords(3)))) # optional - sage.combinat
301
+ sage: factory.build_set(sorted(set(DyckWords(3)))) # needs sage.combinat
302
302
{ /\ }
303
303
{ /\ /\ /\/\ / \ }
304
304
{ /\/\/\, /\/ \, / \/\, / \, / \ }
@@ -315,14 +315,15 @@ def build_dict(self, d, baseline=0):
315
315
316
316
TESTS::
317
317
318
+ sage: # needs sage.combinat
318
319
sage: from collections import OrderedDict
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
320
+ sage: d = OrderedDict(enumerate(DyckWords(3)))
321
+ sage: art = ascii_art(d) # indirect doctest
322
+ sage: art
322
323
{ /\ }
323
324
{ /\ /\ /\/\ / \ }
324
325
{ 0:/\/\/\, 1:/\/ \, 2:/ \/\, 3:/ \, 4:/ \ }
325
- sage: art._breakpoints # optional - sage.combinat
326
+ sage: art._breakpoints
326
327
[11, 21, 31, 41]
327
328
328
329
Check that :trac:`29447` is fixed::
@@ -357,18 +358,18 @@ def build_list(self, l, baseline=0):
357
358
358
359
TESTS::
359
360
360
- sage: l = ascii_art(list(DyckWords(3))) # indirect doctest # optional - sage.combinat
361
- sage: l # optional - sage.combinat
361
+ sage: l = ascii_art(list(DyckWords(3))) # indirect doctest # needs sage.combinat
362
+ sage: l # needs sage.combinat
362
363
[ /\ ]
363
364
[ /\ /\ /\/\ / \ ]
364
365
[ /\/\/\, /\/ \, / \/\, / \, / \ ]
365
- sage: l._breakpoints # optional - sage.combinat
366
+ sage: l._breakpoints # needs sage.combinat
366
367
[9, 17, 25, 33]
367
368
368
369
The breakpoints of the object are used as breakpoints::
369
370
370
- sage: l = ascii_art([DyckWords(2).list(), DyckWords(2).list()]) # optional - sage.combinat
371
- sage: l._breakpoints # optional - sage.combinat
371
+ sage: l = ascii_art([DyckWords(2).list(), DyckWords(2).list()]) # needs sage.combinat
372
+ sage: l._breakpoints # needs sage.combinat
372
373
[(2, [7]), 17, (18, [7])]
373
374
374
375
The parentheses only stretch as high as the content (:trac:`28527`)::
@@ -399,7 +400,7 @@ def build_tuple(self, t, baseline=0):
399
400
400
401
TESTS::
401
402
402
- sage: ascii_art(tuple(DyckWords(3))) # indirect doctest # optional - sage.combinat
403
+ sage: ascii_art(tuple(DyckWords(3))) # indirect doctest # needs sage.combinat
403
404
( /\ )
404
405
( /\ /\ /\/\ / \ )
405
406
( /\/\/\, /\/ \, / \/\, / \, / \ )
@@ -440,8 +441,8 @@ def concatenate(self, iterable, separator, empty=None, baseline=0,
440
441
441
442
EXAMPLES::
442
443
443
- sage: i2 = identity_matrix(2) # optional - sage.modules
444
- sage: ascii_art(i2, i2, i2, sep=ascii_art(1/x)) # optional - sage.modules sage.symbolic
444
+ sage: i2 = identity_matrix(2) # needs sage.modules
445
+ sage: ascii_art(i2, i2, i2, sep=ascii_art(1/x)) # needs sage.modules sage.symbolic
445
446
1 1
446
447
[1 0]-[1 0]-[1 0]
447
448
[0 1]x[0 1]x[0 1]
0 commit comments