Skip to content

Commit 1af83d1

Browse files
committed
Add # needs in various places
1 parent 4728ca2 commit 1af83d1

File tree

11 files changed

+34
-21
lines changed

11 files changed

+34
-21
lines changed

src/sage/env.py

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ def cython_aliases(required_modules=None, optional_modules=None):
373373
374374
EXAMPLES::
375375
376+
sage: # needs sage.misc.cython (actually just pkgconfig)
376377
sage: from sage.env import cython_aliases
377378
sage: cython_aliases()
378379
{...}

src/sage/features/databases.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DatabaseCremona(StaticFile):
5353
EXAMPLES::
5454
5555
sage: from sage.features.databases import DatabaseCremona
56-
sage: DatabaseCremona('cremona_mini', type='standard').is_present()
56+
sage: DatabaseCremona('cremona_mini', type='standard').is_present() # needs database_cremona_mini_ellcurve
5757
FeatureTestResult('database_cremona_mini_ellcurve', True)
5858
sage: DatabaseCremona().is_present() # optional - database_cremona_ellcurve
5959
FeatureTestResult('database_cremona_ellcurve', True)

src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1522,8 +1522,9 @@ def perpendicular_bisector(self): # UHP
15221522
15231523
EXAMPLES::
15241524
1525-
sage: # needs scipy
15261525
sage: UHP = HyperbolicPlane().UHP()
1526+
1527+
sage: # needs scipy
15271528
sage: g = UHP.random_geodesic()
15281529
sage: h = g.perpendicular_bisector().complete()
15291530
sage: c = lambda x: x.coordinates()
@@ -1533,10 +1534,9 @@ def perpendicular_bisector(self): # UHP
15331534
::
15341535
15351536
sage: # needs scipy
1536-
sage: UHP = HyperbolicPlane().UHP()
1537-
sage: g = UHP.get_geodesic(1+I,2+0.5*I)
1537+
sage: g = UHP.get_geodesic(1 + I, 2 + 0.5*I)
15381538
sage: h = g.perpendicular_bisector().complete()
1539-
sage: show(g.plot(color='blue')+h.plot(color='orange'))
1539+
sage: show(g.plot(color='blue') + h.plot(color='orange'))
15401540
15411541
.. PLOT::
15421542

src/sage/groups/matrix_gps/matrix_group.py

+1
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ def sign_representation(self, base_ring=None):
371371
sage: m2*e*e
372372
2*B['v']
373373
374+
sage: # needs sage.groups
374375
sage: W = WeylGroup(["A", 1, 1])
375376
sage: W.sign_representation()
376377
Sign representation of

src/sage/interfaces/magma.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def extcode_dir(iface=None):
246246
247247
EXAMPLES::
248248
249-
sage: sage.interfaces.magma.extcode_dir()
249+
sage: from sage.interfaces.magma import extcode_dir
250+
sage: extcode_dir()
250251
'...dir_.../data/'
251252
"""
252253
global EXTCODE_DIR
@@ -2783,6 +2784,7 @@ def __init__(self, verbosity=1, style='magma'):
27832784
27842785
EXAMPLES::
27852786
2787+
sage: # needs sage.libs.singular
27862788
sage: P.<x,y,z> = GF(32003)[]
27872789
sage: I = sage.rings.ideal.Cyclic(P)
27882790
sage: _ = I.groebner_basis('magma',prot='sage') # indirect doctest, optional - magma, not tested
@@ -2792,6 +2794,7 @@ def __init__(self, verbosity=1, style='magma'):
27922794
27932795
Highest degree reached during computation: 3.
27942796
2797+
sage: # needs sage.libs.singular
27952798
sage: P.<x,y,z> = GF(32003)[]
27962799
sage: I = sage.rings.ideal.Cyclic(P)
27972800
sage: _ = I.groebner_basis('magma',prot=True) # indirect doctest, optional - magma, not tested
@@ -2852,6 +2855,7 @@ def write(self, s):
28522855
"""
28532856
EXAMPLES::
28542857
2858+
sage: # needs sage.libs.singular
28552859
sage: P.<x,y,z> = GF(32003)[]
28562860
sage: I = sage.rings.ideal.Katsura(P)
28572861
sage: _ = I.groebner_basis('magma',prot=True) # indirect doctest, optional - magma
@@ -2988,6 +2992,7 @@ def magma_gb_standard_options(func):
29882992
29892993
EXAMPLES::
29902994
2995+
sage: # needs sage.libs.singular
29912996
sage: P.<a,b,c,d,e> = PolynomialRing(GF(127))
29922997
sage: J = sage.rings.ideal.Cyclic(P).homogenize()
29932998
sage: from sage.misc.sageinspect import sage_getsource

src/sage/manifolds/differentiable/integrated_curve.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
4646
Plot the geodesic after interpolating the solution ``sol``::
4747
48-
sage: interp = c.interpolate()
48+
sage: interp = c.interpolate() # needs scipy
4949
50-
sage: # needs sage.plot
50+
sage: # needs scipy sage.plot
5151
sage: graph = c.plot_integrated()
5252
sage: p_plot = p.plot(size=30, label_offset=-0.07, fontsize=20)
5353
sage: v_plot = v.plot(label_offset=0.05, fontsize=20)
@@ -1544,17 +1544,17 @@ def solve_across_charts(self, charts=None, step=None, solution_key=None,
15441544
15451545
The interpolation is done as usual::
15461546
1547-
sage: interp = c.interpolate()
1547+
sage: interp = c.interpolate() # needs scipy
15481548
15491549
To plot the result, you must first be sure that the mapping
15501550
encompasses all the chart, which is the case here.
15511551
You must also specify ``across_charts=True`` in order to call
15521552
:meth:`plot_integrated` again on each part.
15531553
Finally, ``color`` can be a list, which will be cycled through::
15541554
1555-
sage: fig += c.plot_integrated(mapping=phi, color=["green","red"], # needs sage.plot
1555+
sage: fig += c.plot_integrated(mapping=phi, color=["green","red"], # needs scipy sage.plot
15561556
....: thickness=3, plot_points=100, across_charts=True)
1557-
sage: fig # needs sage.plot
1557+
sage: fig # needs scipy sage.plot
15581558
Graphics object consisting of 43 graphics primitives
15591559
15601560
.. PLOT::
@@ -1948,7 +1948,7 @@ def interpolate(self, solution_key=None, method=None,
19481948
...
19491949
ValueError: no existing key 'my solution' referring to any
19501950
numerical solution
1951-
sage: interp = c.interpolate(solution_key='sol_T1',
1951+
sage: interp = c.interpolate(solution_key='sol_T1', # needs scipy
19521952
....: method='my method')
19531953
Traceback (most recent call last):
19541954
...
@@ -3099,6 +3099,7 @@ class IntegratedAutoparallelCurve(IntegratedCurve):
30993099
Plot the resulting curves on the grid of polar coordinates lines on
31003100
`\mathbb{S}^{2}`::
31013101
3102+
sage: # needs sage.plot
31023103
sage: graph3D_embedded_curves = Graphics()
31033104
sage: for key in dict_params:
31043105
....: graph3D_embedded_curves += c.plot_integrated(interpolation_key='interp-'+key,

src/sage/matrix/matrix2.pyx

+5-5
Original file line numberDiff line numberDiff line change
@@ -778,15 +778,15 @@ cdef class Matrix(Matrix1):
778778
A degenerate case::
779779

780780
sage: A = matrix(RDF, 0, 0, [])
781-
sage: A.solve_right(vector(RDF,[]))
781+
sage: A.solve_right(vector(RDF,[])) # needs scipy
782782
()
783783

784784
Over an inexact ring like ``RDF``, the coefficient matrix of a
785785
square system must be nonsingular::
786786

787787
sage: A = matrix(RDF, 5, range(25))
788788
sage: b = vector(RDF, [1,2,3,4,5])
789-
sage: A.solve_right(b)
789+
sage: A.solve_right(b) # needs scipy
790790
Traceback (most recent call last):
791791
...
792792
LinAlgError: Matrix is singular.
@@ -795,7 +795,7 @@ cdef class Matrix(Matrix1):
795795

796796
sage: A = matrix(RDF, 5, range(25))
797797
sage: b = vector(RDF, [1,2,3,4])
798-
sage: A.solve_right(b)
798+
sage: A.solve_right(b) # needs sage.rings.finite_rings
799799
Traceback (most recent call last):
800800
...
801801
ValueError: number of rows of self must equal degree of
@@ -1768,7 +1768,7 @@ cdef class Matrix(Matrix1):
17681768

17691769
Although it is not too far off::
17701770

1771-
sage: (~M - M.pseudoinverse(algorithm='numpy')).norm() < 1e-14 # needs numpy
1771+
sage: (~M - M.pseudoinverse(algorithm='numpy')).norm() < 1e-14 # needs scipy
17721772
True
17731773

17741774
TESTS::
@@ -7359,7 +7359,7 @@ cdef class Matrix(Matrix1):
73597359

73607360
The following example shows that :issue:`12595` has been resolved::
73617361

7362-
sage: # needs sage.rings.complex_double
7362+
sage: # needs scipy sage.rings.complex_double
73637363
sage: m = Matrix(CDF, 8, [[-1, -1, -1, -1, 1, -3, -1, -1],
73647364
....: [1, 1, 1, 1, -1, -1, 1, -3],
73657365
....: [-1, 3, -1, -1, 1, 1, -1, -1],

src/sage/matrix/matrix_double_dense.pyx

+5-2
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
299299
[4.0 5.0 6.0]
300300
[7.0 8.0 9.0]
301301
302-
sage: A.determinant() < 10e-12
302+
sage: A.determinant() < 10e-12 # needs scipy
303303
True
304304
305305
TESTS::
@@ -850,7 +850,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
850850
851851
Bogus values of the ``eps`` keyword will be caught::
852852
853-
sage: A.singular_values(eps='junk')
853+
sage: A.singular_values(eps='junk') # needs scipy
854854
Traceback (most recent call last):
855855
...
856856
ValueError: could not convert string to float: ...
@@ -1012,6 +1012,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
10121012
10131013
The results are immutable since they are cached. ::
10141014
1015+
sage: # needs scipy
10151016
sage: P, L, U = matrix(RDF, 2, 2, range(4)).LU()
10161017
sage: L[0,0] = 0
10171018
Traceback (most recent call last):
@@ -1214,6 +1215,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
12141215
In this generalized eigenvalue problem, the homogeneous coordinates
12151216
explain the output obtained for the eigenvalues::
12161217
1218+
sage: # needs scipy
12171219
sage: A = matrix.identity(RDF, 2)
12181220
sage: B = matrix(RDF, [[3, 5], [6, 10]])
12191221
sage: A.eigenvalues(B) # tol 1e-14
@@ -2907,6 +2909,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
29072909
A small matrix that does not fit into any of the usual categories
29082910
of normal matrices. ::
29092911
2912+
sage: # needs scipy
29102913
sage: A = matrix(RDF, [[1, -1],
29112914
....: [1, 1]])
29122915
sage: A.is_normal()

src/sage/misc/session.pyx

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ def save_session(name='sage_session', verbose=False):
291291
292292
Something similar happens for cython-defined functions::
293293
294+
sage: # needs sage.misc.cython
294295
sage: g = cython_lambda('double x', 'x*x + 1.5')
295296
sage: save_session(tmp_f, verbose=True)
296297
...

src/sage/quivers/ar_quiver.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# sage_setup: distribution = sagemath-flint
2+
# sage.doctest: needs sage.graphs sage.modules
23
r"""
34
Auslander-Reiten Quivers
45
"""

src/sage/rings/valuation/valuation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ def montes_factorization(self, G, assume_squarefree=False, required_precision=No
988988
sage: S.<x> = R[]
989989
sage: f = (x^6+2)^25 + 5
990990
sage: v = R.valuation()
991-
sage: v.montes_factorization(f, assume_squarefree=True, required_precision=0)
991+
sage: v.montes_factorization(f, assume_squarefree=True, required_precision=0) # needs sage.geometry.polyhedron
992992
(x^50 + 2*5*x^45 + 5*x^40 + 5*x^30 + 2*x^25 + 3*5*x^20 + 2*5*x^10 + 2*5*x^5 + 5*x + 3 + 5) * (x^50 + 3*5*x^45 + 5*x^40 + 5*x^30 + (3 + 4*5)*x^25 + 3*5*x^20 + 2*5*x^10 + 3*5*x^5 + 4*5*x + 3 + 5) * (x^50 + 3*5*x^40 + 3*5*x^30 + 4*5*x^20 + 5*x^10 + 3 + 5)
993993
994994
In this case, ``f`` factors into degrees 1, 2, and 5 over a totally ramified extension::
@@ -1000,7 +1000,7 @@ def montes_factorization(self, G, assume_squarefree=False, required_precision=No
10001000
sage: S.<x> = R[]
10011001
sage: f = (x^3 + 5)*(x^5 + w) + 625
10021002
sage: v = R.valuation()
1003-
sage: v.montes_factorization(f, assume_squarefree=True, required_precision=0) # needs sage.libs.flint
1003+
sage: v.montes_factorization(f, assume_squarefree=True, required_precision=0) # needs sage.geometry.polyhedron sage.libs.flint
10041004
((1 + O(w^60))*x + 4*w + O(w^61)) * ((1 + O(w^60))*x^2 + (w + O(w^61))*x + w^2 + O(w^62)) * ((1 + O(w^60))*x^5 + w + O(w^61))
10051005
10061006
REFERENCES:

0 commit comments

Comments
 (0)