Skip to content

Commit b2045ec

Browse files
committed
fix some doctests
1 parent 3f82b0e commit b2045ec

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

demo-constructions-categories-short.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Demonstration: Algebraic constructions and categories
1212
sage: Px.<x> = QQ[]
1313
sage: Fx = Px.fraction_field()
1414

15-
::
15+
.. ::
1616

1717
sage: for category in Fx.categories(): print(category)
1818

1919
::
2020

2121
sage: g = sage.categories.category.category_graph()
2222
sage: g.set_latex_options(format = "dot2tex")
23-
sage: view(g, tightpage = True, viewer = "pdf")
23+
sage: view(g, tightpage = True, viewer = "pdf") # optional - dot2tex

demo-doc.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ examples.
2323
Introspection::
2424

2525
sage: m = matrix([[1/2,1],[2,1]]); m
26+
[1/2 1]
27+
[ 2 1]
2628

2729
.. skip:
2830
@@ -34,6 +36,8 @@ Introspection::
3436

3537
sage: g.
3638

37-
Looking at the sources::
39+
Looking at the sources:
40+
41+
.. skip::
3842

3943
sage: m.det

demo-number-theory.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Construct an elliptic curve using John Cremona's table::
1212

1313
Use *matplotlib* to plot it::
1414

15-
sage: plot(E,thickness=3)
15+
sage: E.plot(thickness=3)
1616

1717
Use *mwrank* to do a 2-descent::
1818

1919
sage: print(E.mwrank())
20-
Curve [0,1,1,-2,0] : Rank = 2
20+
Curve [0,1,1,-2,0] : ...
2121

2222
*PARI* to compute Fourier coefficients `a_n`::
2323

@@ -36,4 +36,4 @@ Use *mwrank* to do a 2-descent::
3636

3737
*Magma* to compute the rank of the 3-selmer group::
3838

39-
sage: magma(E).ThreeSelmerGroup()
39+
sage: magma(E).ThreeSelmerGroup() # optional - magma

demo-plot-short.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@ Demonstration: Plots (short version)
77
Some nice plots::
88

99
sage: plot(sin(x), -2*pi, 2*pi, fill = 'axis')
10+
Graphics object consisting of 2 graphics primitives
1011

1112
Taylor approximation::
1213

1314
sage: f = sin(x)
1415
sage: g = f.taylor(x,0,3)
1516
sage: plot(g, -2*pi, 2*pi)
17+
Graphics object consisting of 1 graphics primitive
1618

1719
All the way to a full featured applet::
1820

19-
sage: %hide
20-
sage: var('x')
21-
sage: @interact
22-
sage: def g(f=sin(x), c=0, n=(1..30),
21+
sage: x = var('x')
22+
sage: @interact # not tested
23+
....: def g(f=sin(x), c=0, n=(1..30),
2324
....: xinterval=range_slider(-10, 10, 1, default=(-8,8), label="x-interval"),
2425
....: yinterval=range_slider(-50, 50, 1, default=(-3,3), label="y-interval")):
2526
....: x0 = c
@@ -31,6 +32,5 @@ All the way to a full featured applet::
3132
....: ft = f.taylor(x,x0,degree)
3233
....: pt = plot(ft, xmin, xmax, color='red', thickness=2, fill=f)
3334
....: show(dot + p + pt, ymin=ymin, ymax=ymax, xmin=xmin, xmax=xmax)
34-
....: html('$f(x)\;=\;%s$'%latex(f))
35-
....: html('$P_{%s}(x)\;=\;%s+R_{%s}(x)$'%(degree,latex(ft),degree))
36-
35+
....: html(r'$f(x)\;=\;%s$'%latex(f))
36+
....: html(r'$P_{%s}(x)\;=\;%s+R_{%s}(x)$'%(degree,latex(ft),degree))

demo-symbolics.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ petits.
1515
Une expression::
1616

1717
sage: f = cos(x)^6 + sin(x)^6 + 3 * sin(x)^2 * cos(x)^2; f
18-
sin(x)^6 + cos(x)^6 + 3*sin(x)^2*cos(x)^2
18+
cos(x)^6 + sin(x)^6 + 3*cos(x)^2*sin(x)^2
1919

20-
La même après avoir configuré les affichages en latex::
20+
La même après avoir configuré les affichages en latex:
21+
22+
.. skip::
2123

2224
sage: %display latex
2325
sage: f

0 commit comments

Comments
 (0)