Skip to content

Commit 2ea7108

Browse files
author
Matthias Koeppe
committed
src/sage/misc: sage -fixdoctests --only-tags
1 parent ac6b955 commit 2ea7108

30 files changed

+245
-231
lines changed

src/sage/misc/binary_tree.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ cdef class BinaryTree:
285285
286286
sage: from sage.misc.binary_tree import BinaryTree
287287
sage: t = BinaryTree()
288-
sage: t.insert(0, Matrix([[0,0], [1,1]])) # optional - sage.modules
288+
sage: t.insert(0, Matrix([[0,0], [1,1]])) # needs sage.modules
289289
sage: t.insert(0, 1)
290-
sage: t.get(0) # optional - sage.modules
290+
sage: t.get(0) # needs sage.modules
291291
[0 0]
292292
[1 1]
293293
"""

src/sage/misc/call.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def __call__(self, x, *args):
4040
EXAMPLES::
4141
4242
sage: core = attrcall('core', 3)
43-
sage: core(Partition([4,2])) # optional - sage.combinat
43+
sage: core(Partition([4,2])) # needs sage.combinat
4444
[4, 2]
4545
46-
sage: series = attrcall('series', x) # optional - sage.symbolic
47-
sage: series(sin(x), 4) # optional - sage.symbolic
46+
sage: series = attrcall('series', x) # needs sage.symbolic
47+
sage: series(sin(x), 4) # needs sage.symbolic
4848
1*x + (-1/6)*x^3 + Order(x^4)
4949
"""
5050
return getattr(x, self.name)(*(self.args + args), **self.kwds)
@@ -159,7 +159,7 @@ def attrcall(name, *args, **kwds):
159159
160160
sage: f = attrcall('core', 3); f
161161
*.core(3)
162-
sage: [f(p) for p in Partitions(5)] # optional - sage.combinat
162+
sage: [f(p) for p in Partitions(5)] # needs sage.combinat
163163
[[2], [1, 1], [1, 1], [3, 1, 1], [2], [2], [1, 1]]
164164
"""
165165
return AttrCallObject(name, args, kwds)

src/sage/misc/citation.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ def get_systems(cmd):
7171
sage: from sage.misc.citation import get_systems
7272
sage: get_systems('print("hello")') # random (may print warning)
7373
[]
74-
sage: integrate(x^2, x) # Priming coercion model # optional - sage.symbolic
74+
sage: integrate(x^2, x) # Priming coercion model # needs sage.symbolic
7575
1/3*x^3
76-
sage: get_systems('integrate(x^2, x)') # optional - sage.symbolic
76+
sage: get_systems('integrate(x^2, x)') # needs sage.symbolic
7777
['Maxima', 'ginac']
7878
sage: R.<x,y,z> = QQ[]
7979
sage: I = R.ideal(x^2+y^2, z^2+y)

src/sage/misc/classcall_metaclass.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ cdef class ClasscallMetaclass(NestedClassMetaclass):
7979
8080
TESTS::
8181
82-
sage: PerfectMatchings(2).list()
82+
sage: PerfectMatchings(2).list() # needs sage.combinat
8383
[[(1, 2)]]
8484
8585
.. NOTE::
@@ -271,12 +271,12 @@ cdef class ClasscallMetaclass(NestedClassMetaclass):
271271
The benefit, compared with using a wrapper function, is that the
272272
user interface has a single handle for the class::
273273
274-
sage: x = Partition([3,2,2])
275-
sage: isinstance(x, Partition) # todo: not implemented
274+
sage: x = Partition([3,2,2]) # needs sage.combinat
275+
sage: isinstance(x, Partition) # not implemented # needs sage.combinat
276276
277277
instead of::
278278
279-
sage: isinstance(x, sage.combinat.partition.Partition)
279+
sage: isinstance(x, sage.combinat.partition.Partition) # needs sage.combinat
280280
True
281281
282282
Another difference is that ``__classcall__`` is inherited by

src/sage/misc/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def find_library(name):
9393
EXAMPLES::
9494
9595
sage: from sage.misc.compat import find_library
96-
sage: find_library('giac') # optional - sage.libs.giac
96+
sage: find_library('giac') # needs sage.libs.giac
9797
'...giac...'
9898
9999
"""

src/sage/misc/converting_dict.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
2929
sage: K.<x,y> = QQ[]
3030
sage: I = ideal([x^2 + 2*y - 5, x + y + 3])
31-
sage: V = sorted(I.variety(AA), key=str) # optional - sage.rings.number_field
32-
sage: v = V[0] # optional - sage.rings.number_field
33-
sage: v['x'], v['y'] # optional - sage.rings.number_field
31+
sage: V = sorted(I.variety(AA), key=str) # needs sage.rings.number_field
32+
sage: v = V[0] # needs sage.rings.number_field
33+
sage: v['x'], v['y'] # needs sage.rings.number_field
3434
(-2.464101615137755?, -0.535898384862246?)
35-
sage: list(v)[0].parent() # optional - sage.rings.number_field
35+
sage: list(v)[0].parent() # needs sage.rings.number_field
3636
Multivariate Polynomial Ring in x, y over Algebraic Real Field
3737
"""
3838
# ****************************************************************************

src/sage/misc/decorators.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def sage_wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES):
6767
....: return x
6868
sage: g(2)
6969
4
70-
sage: g(x) # optional - sage.symbolic
70+
sage: g(x) # needs sage.symbolic
7171
x^2
7272
sage: g.__doc__
7373
'My little function'
@@ -104,7 +104,7 @@ def sage_wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES):
104104
sage: I = P*[x,y]
105105
sage: sage_getfile(I.interreduced_basis) # known bug
106106
'.../sage/rings/polynomial/multi_polynomial_ideal.py'
107-
sage: sage_getsourcelines(I.interreduced_basis) # optional - sage.libs.singular
107+
sage: sage_getsourcelines(I.interreduced_basis) # needs sage.libs.singular
108108
([' @handle_AA_and_QQbar\n',
109109
' @singular_gb_standard_options\n',
110110
' @libsingular_gb_standard_options\n',
@@ -192,29 +192,29 @@ class infix_operator():
192192
....: def dot(a, b):
193193
....: '''Dot product.'''
194194
....: return a.dot_product(b)
195-
sage: u = vector([1, 2, 3]) # optional - sage.modules
196-
sage: v = vector([5, 4, 3]) # optional - sage.modules
197-
sage: u *dot* v # optional - sage.modules
195+
sage: u = vector([1, 2, 3]) # needs sage.modules
196+
sage: v = vector([5, 4, 3]) # needs sage.modules
197+
sage: u *dot* v # needs sage.modules
198198
22
199199
200200
An infix element-wise addition operator::
201201
202202
sage: @infix_operator('add')
203203
....: def eadd(a, b):
204204
....: return a.parent([i + j for i, j in zip(a, b)])
205-
sage: u = vector([1, 2, 3]) # optional - sage.modules
206-
sage: v = vector([5, 4, 3]) # optional - sage.modules
207-
sage: u +eadd+ v # optional - sage.modules
205+
sage: u = vector([1, 2, 3]) # needs sage.modules
206+
sage: v = vector([5, 4, 3]) # needs sage.modules
207+
sage: u +eadd+ v # needs sage.modules
208208
(6, 6, 6)
209-
sage: 2*u +eadd+ v # optional - sage.modules
209+
sage: 2*u +eadd+ v # needs sage.modules
210210
(7, 8, 9)
211211
212212
A hack to simulate a postfix operator::
213213
214214
sage: @infix_operator('or')
215215
....: def thendo(a, b):
216216
....: return b(a)
217-
sage: x |thendo| cos |thendo| (lambda x: x^2) # optional - sage.symbolic
217+
sage: x |thendo| cos |thendo| (lambda x: x^2) # needs sage.symbolic
218218
cos(x)^2
219219
"""
220220

src/sage/misc/dev_tools.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ def find_objects_from_name(name, module_name=None):
219219
EXAMPLES::
220220
221221
sage: import sage.misc.dev_tools as dt
222-
sage: dt.find_objects_from_name('FareySymbol') # optional - sage.modular
222+
sage: dt.find_objects_from_name('FareySymbol') # needs sage.modular
223223
[<class 'sage.modular.arithgroup.farey_symbol.Farey'>]
224224
225-
sage: import sympy
226-
sage: dt.find_objects_from_name('RR')
225+
sage: import sympy # needs sympy
226+
sage: dt.find_objects_from_name('RR') # needs sympy
227227
[Real Field with 53 bits of precision, RR]
228-
sage: dt.find_objects_from_name('RR', 'sage')
228+
sage: dt.find_objects_from_name('RR', 'sage') # needs sympy
229229
[Real Field with 53 bits of precision]
230-
sage: dt.find_objects_from_name('RR', 'sympy')
230+
sage: dt.find_objects_from_name('RR', 'sympy') # needs sympy
231231
[RR]
232232
233233
Examples that do not belong to the global namespace but in a loaded module::
@@ -270,7 +270,7 @@ def find_object_modules(obj):
270270
EXAMPLES::
271271
272272
sage: from sage.misc.dev_tools import find_object_modules
273-
sage: find_object_modules(RR) # optional - sage.rings.real_mpfr
273+
sage: find_object_modules(RR) # needs sage.rings.real_mpfr
274274
{'sage.rings.real_mpfr': ['RR']}
275275
sage: find_object_modules(ZZ)
276276
{'sage.rings.integer_ring': ['Z', 'ZZ']}
@@ -353,7 +353,7 @@ def import_statements(*objects, **kwds):
353353
354354
EXAMPLES::
355355
356-
sage: import_statements(WeylGroup, lazy_attribute) # optional - sage.libs.gap
356+
sage: import_statements(WeylGroup, lazy_attribute) # needs sage.libs.gap
357357
from sage.combinat.root_system.weyl_group import WeylGroup
358358
from sage.misc.lazy_attribute import lazy_attribute
359359
@@ -363,7 +363,7 @@ def import_statements(*objects, **kwds):
363363
If ``lazy`` is True, then :func:`lazy_import` statements are
364364
displayed instead::
365365
366-
sage: import_statements(WeylGroup, lazy_attribute, lazy=True) # optional - sage.libs.gap
366+
sage: import_statements(WeylGroup, lazy_attribute, lazy=True) # needs sage.libs.gap
367367
from sage.misc.lazy_import import lazy_import
368368
lazy_import('sage.combinat.root_system.weyl_group', 'WeylGroup')
369369
lazy_import('sage.misc.lazy_attribute', 'lazy_attribute')
@@ -381,21 +381,21 @@ def import_statements(*objects, **kwds):
381381
sage: import_statements(euler_phi)
382382
from sage.arith.misc import euler_phi
383383
384-
sage: import_statements(x) # optional - sage.symbolic
384+
sage: import_statements(x) # needs sage.symbolic
385385
from sage.calculus.predefined import x
386386
387387
If you don't like the warning you can disable them with the option ``verbose``::
388388
389389
sage: import_statements(ZZ, verbose=False)
390390
from sage.rings.integer_ring import Z
391391
392-
sage: import_statements(x, verbose=False) # optional - sage.symbolic
392+
sage: import_statements(x, verbose=False) # needs sage.symbolic
393393
from sage.calculus.predefined import x
394394
395395
If the object has several names, an other way to get the import
396396
statement you expect is to use a string instead of the object::
397397
398-
sage: import_statements(matrix) # optional - sage.modules
398+
sage: import_statements(matrix) # needs sage.modules
399399
# ** Warning **: several names for that object: Matrix, matrix
400400
from sage.matrix.constructor import Matrix
401401
@@ -410,7 +410,7 @@ def import_statements(*objects, **kwds):
410410
The strings are allowed to be comma-separated names, and parenthesis
411411
are stripped for convenience::
412412
413-
sage: import_statements('(floor, ceil)') # optional - sage.symbolic
413+
sage: import_statements('(floor, ceil)') # needs sage.symbolic
414414
from sage.functions.other import floor, ceil
415415
416416
Specifying a string is also useful for objects that are not
@@ -487,9 +487,9 @@ def import_statements(*objects, **kwds):
487487
from sage.combinat.partition_algebra import SetPartitionsAk
488488
sage: import_statements(CIF)
489489
from sage.rings.cif import CIF
490-
sage: import_statements(NaN) # optional - sage.symbolic
490+
sage: import_statements(NaN) # needs sage.symbolic
491491
from sage.symbolic.constants import NaN
492-
sage: import_statements(pi) # optional - sage.symbolic
492+
sage: import_statements(pi) # needs sage.symbolic
493493
from sage.symbolic.constants import pi
494494
sage: import_statements('SAGE_ENV')
495495
from sage.env import SAGE_ENV

src/sage/misc/edit_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def file_and_line(obj):
8080
8181
The following tests against a bug that was fixed in :trac:`11298`::
8282
83-
sage: edit_module.file_and_line(x) # optional - sage.symbolic
83+
sage: edit_module.file_and_line(x) # needs sage.symbolic
8484
('...sage/symbolic/expression...pyx', ...)
8585
"""
8686
# d = inspect.getdoc(obj)

0 commit comments

Comments
 (0)