Ticket #12415: 12415_doctest_fixes.patch

File 12415_doctest_fixes.patch, 116.2 KB (added by jdemeyer, 7 years ago)

Doctest changes that are needed to account for differences in the new framework

  • doc/de/tutorial/interfaces.rst

    # HG changeset patch
    # User David Roe <roed.math@gmail.com>
    # Date 1340304029 14400
    # Node ID 6f6ae25e6100024053d477fbaa189f415422c1cf
    # Parent  2f84f74b73289ac2bc694898450a49c3695a2409
    Chang various doctests to account for differences between the new framework and the old.
    
    diff --git a/doc/de/tutorial/interfaces.rst b/doc/de/tutorial/interfaces.rst
    a b  
    208208    //                  : names    x y
    209209    //        block   2 : ordering C
    210210    sage: f = singular('9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + \
    211     ...  9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - \
    212     ...  9*x^12*y^3 - 18*x^13*y^2 + 9*x^16')
     211    ....: 9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - \
     212    ....: 9*x^12*y^3 - 18*x^13*y^2 + 9*x^16')
    213213
    214214Wir haben also das Polynom :math:`f` definiert, nun geben wir es aus und faktorisieren es.
    215215
     
    239239::
    240240
    241241    sage: x, y = QQ['x, y'].gens()
    242     sage: f = 9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + 9*x^6*y^4\
    243     ...   + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - 9*x^12*y^3\
    244     ...  - 18*x^13*y^2 + 9*x^16
     242    sage: f = 9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + 9*x^6*y^4 \
     243    ....: + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - 9*x^12*y^3 \
     244    ....: - 18*x^13*y^2 + 9*x^16
    245245    sage: factor(f)
    246246    (9) * (-x^5 + y^2)^2 * (x^6 - 2*x^3*y^2 - x^2*y^3 + y^4)
    247247
     
    312312
    313313::
    314314
    315     sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\
    316     ...   '[plot_format,openmath]') # not tested
     315    sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested
     316    ....: '[plot_format,openmath]')
    317317
    318318Ein "live" 3D-Plot, den man mit der Maus bewegen kann:
    319319
    320320::
    321321
    322     sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\
    323     ...   '[plot_format, openmath]') # not tested
    324     sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\
    325     ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested
     322    sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested
     323    ....: '[plot_format, openmath]')
     324    sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested
     325    ....: "[grid, 50, 50]",'[plot_format, openmath]')
    326326
    327327Der nächste Plot ist das berühmte Möbiusband:
    328328
    329329::
    330330
    331     sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\
    332     ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\
    333     ...   '[plot_format, openmath]') # not tested
     331    sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested
     332    ....: "[x, -4, 4]", "[y, -4, 4]",
     333    ....: '[plot_format, openmath]')
    334334
    335335Und der letzte ist die berühmte Kleinsche Flasche:
    336336
    337337::
    338338
    339     sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\
    340     ...   - 10.0")
     339    sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0")
    341340    5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0
    342341    sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)")
    343342    -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)
    344343    sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))")
    345344    5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y))
    346     sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\
    347     ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\
    348     ...   '[plot_format, openmath]') # not tested
     345    sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested
     346    ....: "[y, -%pi, %pi]", "['grid, 40, 40]",
     347    ....: '[plot_format, openmath]')
    349348   
  • doc/de/tutorial/programming.rst

    diff --git a/doc/de/tutorial/programming.rst b/doc/de/tutorial/programming.rst
    a b  
    618618::
    619619
    620620    >>> for i in range(5):
    621            print(i)
    622        
     621    ...     print(i)
     622    ...
    623623    0
    624624    1
    625625    2
     
    636636::
    637637
    638638    sage: for i in range(5):
    639     ...       print(i)  # now hit enter twice
     639    ....:     print(i)  # now hit enter twice
     640    ....:
    640641    0
    641642    1
    642643    2
  • doc/en/bordeaux_2008/elliptic_curves.rst

    diff --git a/doc/en/bordeaux_2008/elliptic_curves.rst b/doc/en/bordeaux_2008/elliptic_curves.rst
    a b  
    369369::
    370370
    371371    sage: L.zeros(10)
     372      ***   Warning: new stack size = ...
    372373    [0.000000000, 0.000000000, 2.87609907, 4.41689608, 5.79340263,
    373374     6.98596665, 7.47490750, 8.63320525, 9.63307880, 10.3514333]
    374375
  • doc/en/constructions/plotting.rst

    diff --git a/doc/en/constructions/plotting.rst b/doc/en/constructions/plotting.rst
    a b  
    197197
    198198::
    199199
    200     sage: maxima.plot2d('cos(2*x) + 2*exp(-x)','[x,0,1]',\
    201     ...   '[plot_format,openmath]')  # optional -- pops up a window.
     200    sage: maxima.plot2d('cos(2*x) + 2*exp(-x)','[x,0,1]', # optional -- pops up a window.
     201    ....: '[plot_format,openmath]')
    202202
    203203(Mac OS X users: Note that these ``openmath`` commands were run in a
    204204session of started in an xterm shell, not using the standard Mac
     
    226226
    227227::
    228228
    229     sage: maxima.plot3d ("sin(x^2 + y^2)", "[x, -3, 3]", "[y, -3, 3]",\
    230     ...   '[plot_format, openmath]') #optional
     229    sage: maxima.plot3d ("sin(x^2 + y^2)", "[x, -3, 3]", "[y, -3, 3]", # optional
     230    ....: '[plot_format, openmath]')
    231231
    232232By rotating this suitably, you can view the contour plot.
    233233
  • doc/en/developer/coding_in_other.rst

    diff --git a/doc/en/developer/coding_in_other.rst b/doc/en/developer/coding_in_other.rst
    a b  
    210210parsed and converted if possible to a corresponding Sage/Python
    211211object.
    212212
     213.. skip
     214
    213215::
    214216
    215217    def cartan_matrix(type, rank):
     
    439441          -2   # 64-bit
    440442       [2]:
    441443          0    # 32-bit
    442           -1   # 64-bit
     444          1    # 64-bit
    443445       [3]:
    444446          1
    445447    ...
     
    451453`L`. Python has some very useful string manipulation commands to do
    452454just that.
    453455
     456.. skip
     457
    454458::
    455459
    456460    def points_parser(string_points,F):
     
    512516Singular and Sage unless `d=1`. So, for this reason, we restrict
    513517ourselves to points of degree one.
    514518
     519.. skip
     520
    515521::
    516522
    517523    def places_on_curve(f,F):
     
    525531
    526532        EXAMPLES:
    527533            sage: F=GF(5)
    528             sage: R=MPolynomialRing(F,2,names=["x","y"])
     534            sage: R=PolynomialRing(F,2,names=["x","y"])
    529535            sage: x,y=R.gens()
    530536            sage: f=y^2-x^9-x
    531537            sage: places_on_curve(f,F)
     
    580586    sage: singular.set_ring(R)
    581587    sage: L = singular.new('POINTS')
    582588
     589Note that these elements of L are defined modulo 5 in Singular, and
     590they compare differently than you would expect from their print
     591representation:
     592
    583593.. link
    584594
    585595::
    586596
    587     sage: [(L[i][1], L[i][2], L[i][3]) for i in range(1,7)]
    588     [(0, 1, 0), (2, 2, 1), (0, 0, 1), (-2, -1, 1), (-2, 1, 1), (2, -2, 1)]  # 32-bit
    589     [(0, 1, 0), (-2, 1, 1), (-2, -1, 1), (2, 2, 1), (0, 0, 1), (2, -2, 1)]  # 64-bit
     597    sage: sorted([(L[i][1], L[i][2], L[i][3]) for i in range(1,7)])
     598    [(0, 0, 1), (0, 1, 0), (2, 2, 1), (2, -2, 1), (-2, 1, 1), (-2, -1, 1)]
    590599
    591600Next, we implement the general function (for brevity we omit the
    592601docstring, which is the same as above). Note that the ``point_parser``
  • doc/en/developer/coding_in_python.rst

    diff --git a/doc/en/developer/coding_in_python.rst b/doc/en/developer/coding_in_python.rst
    a b  
    9090
    9191An example template for a ``_latex_`` method follows:
    9292
     93.. skip
     94
    9395::
    9496
    9597    class X:
     
    136138
    137139            sage: pi
    138140            pi
    139             sage: float(pi)
     141            sage: float(pi) # rel tol 1e-10
    140142            3.1415926535897931
    141143        """
    142144        ...
  • doc/en/developer/conventions.rst

    diff --git a/doc/en/developer/conventions.rst b/doc/en/developer/conventions.rst
    a b  
    449449   therefore whom to contact if they have questions).
    450450
    451451Use the following template when documenting functions. Note the
    452 indentation::
     452indentation:
     453
     454.. skip
     455
     456::
    453457
    454458    def point(self, x=1, y=2):
    455459        r"""
     
    793797       sage: U, S, V = A.SVD()
    794798       sage: (U.transpose()*U-identity_matrix(8)).norm(p=2)    # abs tol 1e-10
    795799       0.0
    796        
     800
    797801   The 8-th cyclotomic field is generated by the complex number
    798802   `e^\frac{i\pi}{4}`.  Here we compute a numerical approximation::
    799        
     803
    800804       sage: K.<zeta8> = CyclotomicField(8)
    801805       sage: N(zeta8)                             # absolute tolerance 1e-10
    802806       0.7071067812 + 0.7071067812*I
    803807
    804    The "tolerance" feature checks for floating-point literals, which
    805    may occur anywhere in the doctest output, for example as polynomial
    806    coefficients::
    807 
    808        sage: y = polygen(RDF, 'y')
    809        sage: p = (y - 10^10) * (y - 1); p
    810        y^2 - 10000000001.0*y + 10000000000.0
    811        sage: p                           # rel tol 1e-9
    812        y^2 - 1e10*y + 1e10
    813 
    814 
    815 -  If a line contains ``todo: not implemented``, it is never
    816    tested. It is good to include lines like this to make clear what we
    817    want Sage to eventually implement:
     808   A relative tolerance on a root of a polynomial.  Notice that the
     809   root should normally print as ``1e+16``, or something similar.
     810   However, the tolerance testing causes the doctest framework to use
     811   the output in a *computation*, so other valid text representations
     812   of the predicted value may be used.  However, they must fit the
     813   pattern defined by the regular expression ``float_regex`` in
     814   :mod:`sage.doctest.parsing`.
    818815
    819816   ::
    820817
    821            sage: factor(x*y - x*z)    # todo: not implemented
     818       sage: y = polygen(RDF, 'y')
     819       sage: p = (y - 10^16)*(y-10^(-13))*(y-2); p
     820       y^3 - 1e+16*y^2 + 2e+16*y - 2000.0
     821       sage: p.roots(multiplicities=False)[2]     # relative tol 1e-10
     822       10000000000000000
     823
     824-  If a line contains ``not implemented``, it is never
     825   tested. It is good to include lines like this to make clear what we
     826   want Sage to eventually implement::
     827
     828       sage: factor(x*y - x*z)    # todo: not implemented
    822829
    823830   It is also immediately clear to the user that the indicated example
    824831   does not currently work.
  • doc/en/developer/doctesting.rst

    diff --git a/doc/en/developer/doctesting.rst b/doc/en/developer/doctesting.rst
    a b  
     1.. nodoctest
     2
    13.. _chapter-doctesting:
    24
    35===========================
  • doc/en/developer/sagenb/development_workflow.rst

    diff --git a/doc/en/developer/sagenb/development_workflow.rst b/doc/en/developer/sagenb/development_workflow.rst
    a b  
    123123     #   (use "git add <file>..." to update what will be committed)
    124124     #   (use "git checkout -- <file>..." to discard changes in working directory)
    125125     #
    126      #  modified:   README
     126     #  modified:   README
    127127     #
    128128     # Untracked files:
    129129     #   (use "git add <file>..." to include in what will be committed)
    130130     #
    131      #  INSTALL
     131     #  INSTALL
    132132     no changes added to commit (use "git add" and/or "git commit -a")
    133133
    134134#. Check what the actual changes are with ``git diff`` (`git diff`_).
  • doc/en/developer/sagenb/set_up_fork.rst

    diff --git a/doc/en/developer/sagenb/set_up_fork.rst b/doc/en/developer/sagenb/set_up_fork.rst
    a b  
    5959Just for your own satisfaction, show yourself that you now have a new
    6060'remote', with ``git remote -v show``, giving you something like::
    6161
    62    upstream     git://github.com/sagemath/sagenb.git (fetch)
    63    upstream     git://github.com/sagemath/sagenb.git (push)
    64    origin       git@github.com:your-user-name/sagenb.git (fetch)
    65    origin       git@github.com:your-user-name/sagenb.git (push)
     62   upstream     git://github.com/sagemath/sagenb.git (fetch)
     63   upstream     git://github.com/sagemath/sagenb.git (push)
     64   origin       git@github.com:your-user-name/sagenb.git (fetch)
     65   origin       git@github.com:your-user-name/sagenb.git (push)
    6666
    6767.. include:: links.inc
    6868
  • doc/en/thematic_tutorials/lie/branching_rules.rst

    diff --git a/doc/en/thematic_tutorials/lie/branching_rules.rst b/doc/en/thematic_tutorials/lie/branching_rules.rst
    a b  
    551551    D4(0,0,0,1)
    552552
    553553By contrast, ``rule="automorphic"`` simply interchanges the two
    554 spin representations, as it always does in Type D::
     554spin representations, as it always does in Type D:
    555555
    556556.. link:
    557557
  • doc/en/thematic_tutorials/lie/weyl_character_ring.rst

    diff --git a/doc/en/thematic_tutorials/lie/weyl_character_ring.rst b/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
    a b  
    162162irreducibles, each with multiplicity one.
    163163
    164164The highest weights that appear here are available (with their
    165 coefficients) through the usual free module accessors::
     165coefficients) through the usual free module accessors:
    166166
    167167.. link
    168168
     
    248248So far we have been working with `n=3`. For general `n`::
    249249
    250250   sage: def f(n,k):
    251    ...      R = WeylCharacterRing(['A',n-1])
    252    ...      tr = R(R.fundamental_weights()[1])
    253    ...      return sum(d^2 for d in (tr^k).coefficients())
    254    ...
    255    sage: [f(n,5) for n in [2..7]]
     251   ....:     R = WeylCharacterRing(['A',n-1])
     252   ....:     tr = R(R.fundamental_weights()[1])
     253   ....:     return sum(d^2 for d in (tr^k).coefficients())
     254   ....:
     255   sage: [f(n,5) for n in [2..7]] # long time
    256256   [42, 103, 119, 120, 120, 120]
    257257
    258258We see that the 10-th moment of `tr(g)` is just `5!` when `n` is sufficiently
     
    264264
    265265        sage: [f(2,k) for k in [1..10]]
    266266        [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796]
    267         sage: [catalan_number(k) for k in [1..k]]
     267        sage: [catalan_number(k) for k in [1..10]]
    268268        [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796]
    269269
    270270
     
    537537
    538538        sage: [f(2,k) for k in [1..10]]
    539539        [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796]
    540         sage: [catalan_number(k) for k in [1..k]]
     540        sage: [catalan_number(k) for k in [1..10]]
    541541        [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796]
    542542
    543543
     
    560560    [1, 0, 0, 1, 0, 1, 0]
    561561
    562562If we want the multiplicity of some other representation, we may
    563 obtain that using the method ``multiplicity``::
     563obtain that using the method ``multiplicity``:
    564564
    565565.. link
    566566
  • doc/en/tutorial/interfaces.rst

    diff --git a/doc/en/tutorial/interfaces.rst b/doc/en/tutorial/interfaces.rst
    a b  
    304304Finally, we give an example of using Sage to plot using ``openmath``.
    305305Many of these were modified from the Maxima reference manual.
    306306
    307 A 2D plot of several functions (do not type the ``...``):
     307A 2D plot of several functions (do not type the ``...``)::
    308308
    309 ::
    310 
    311     sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\
    312     ...   '[plot_format,openmath]') # not tested
     309    sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',  # not tested
     310    ....:     '[plot_format,openmath]')
    313311
    314312A "live" 3D plot which you can move with your mouse (do not type
    315 the ``...``):
     313the ``...``)::
    316314
    317 ::
     315    sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",  # not tested
     316    ....:     '[plot_format, openmath]')
     317    sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",  # not tested
     318    ....:     "[grid, 50, 50]",'[plot_format, openmath]')
    318319
    319     sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\
    320     ...   '[plot_format, openmath]') # not tested
    321     sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\
    322     ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested
     320The next plot is the famous Möbius strip (do not type the ``...``)::
    323321
    324 The next plot is the famous Möbius strip (do not type the ``...``):
     322    sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]",  # not tested
     323    ....:     "[x, -4, 4]", "[y, -4, 4]", '[plot_format, openmath]')
    325324
    326 ::
     325The next plot is the famous Klein bottle (do not type the ``...``)::
    327326
    328     sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\
    329     ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\
    330     ...   '[plot_format, openmath]') # not tested
    331 
    332 The next plot is the famous Klein bottle (do not type the ``...``):
    333 
    334 ::
    335 
    336     sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\
    337     ...   - 10.0")
     327    sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0")
    338328    5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0
    339329    sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)")
    340330    -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)
    341331    sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))")
    342332    5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y))
    343     sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\
    344     ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\
    345     ...   '[plot_format, openmath]') # not tested
     333    sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",  # not tested
     334    ....:     "[y, -%pi, %pi]", "['grid, 40, 40]", '[plot_format, openmath]')
  • doc/en/tutorial/programming.rst

    diff --git a/doc/en/tutorial/programming.rst b/doc/en/tutorial/programming.rst
    a b  
    594594::
    595595
    596596    >>> for i in range(5):
    597            print(i)
    598        
     597    ...     print(i)
     598    ...
    599599    0
    600600    1
    601601    2
     
    611611::
    612612
    613613    sage: for i in range(5):
    614     ...       print(i)  # now hit enter twice
     614    ....:     print(i)  # now hit enter twice
     615    ....:
    615616    0
    616617    1
    617618    2
     
    625626::
    626627
    627628    sage: for i in range(15):
    628     ...       if gcd(i,15) == 1:
    629     ...           print(i)
     629    ....:     if gcd(i,15) == 1:
     630    ....:         print(i)
     631    ....:
    630632    1
    631633    2
    632634    4
  • doc/fr/tutorial/interfaces.rst

    diff --git a/doc/fr/tutorial/interfaces.rst b/doc/fr/tutorial/interfaces.rst
    a b  
    318318
    319319::
    320320
    321     sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\
    322     ...   '[plot_format,openmath]') # not tested
     321    sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested
     322    ....: '[plot_format,openmath]')
    323323
    324324Un graphique 3D interactif, que vous pouvez déplacer à la souris
    325325(n'entrez pas les ``...``) :
    326326
    327327::
    328328
    329     sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\
    330     ...   '[plot_format, openmath]') # not tested
    331     sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\
    332     ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested
     329    sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested
     330    ....: '[plot_format, openmath]')
     331    sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested
     332    ....: "[grid, 50, 50]",'[plot_format, openmath]')
    333333
    334334Le célèbre ruban de Möbius (n'entrez pas les ``...``) :
    335335
    336336::
    337337
    338     sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\
    339     ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\
    340     ...   '[plot_format, openmath]') # not tested
     338    sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested
     339    ....: "[x, -4, 4]", "[y, -4, 4]",
     340    ....: '[plot_format, openmath]')
    341341
    342342Et la fameuse bouteille de Klein (n'entrez pas les ``...``):
    343343
     
    350350    -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)
    351351    sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))")
    352352    5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y))
    353     sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\
    354     ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\
    355     ...   '[plot_format, openmath]') # not tested
     353    sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested
     354    ....: "[y, -%pi, %pi]", "['grid, 40, 40]",
     355    ....: '[plot_format, openmath]')
    356356
  • doc/fr/tutorial/programming.rst

    diff --git a/doc/fr/tutorial/programming.rst b/doc/fr/tutorial/programming.rst
    a b  
    613613::
    614614
    615615    >>> for i in range(5):
    616            print(i)
    617        
     616    ...     print(i)
     617    ...
    618618    0
    619619    1
    620620    2
     
    632632::
    633633
    634634    sage: for i in range(5):
    635     ...       print(i)  # appuyez deux fois sur entrée ici
     635    ....:     print(i)  # appuyez deux fois sur entrée ici
    636636    0
    637637    1
    638638    2
  • doc/ru/tutorial/interfaces.rst

    diff --git a/doc/ru/tutorial/interfaces.rst b/doc/ru/tutorial/interfaces.rst
    a b  
    299299
    300300::
    301301
    302     sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\
    303     ...   '[plot_format,openmath]') # not tested
     302    sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested
     303    ...   '[plot_format,openmath]')
    304304
    305305"Живой" трехмерный график, который вы можете вращать мышкой (не вводите ``...``):
    306306
    307307::
    308308
    309     sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\
    310     ...   '[plot_format, openmath]') # not tested
    311     sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\
    312     ...   "[grid, 50, 50]",'[plot_format, openmath]') # not tested
     309    sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested
     310    ...   '[plot_format, openmath]')
     311    sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested
     312    ...   "[grid, 50, 50]",'[plot_format, openmath]')
    313313
    314314Следующий график — это знаменитая Лента Мёбиуса (не вводите ``...``):
    315315
    316316::
    317317
    318     sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\
    319     ...   y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\
    320     ...   '[plot_format, openmath]') # not tested
     318    sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested
     319    ....: "[x, -4, 4]", "[y, -4, 4]",
     320    ....: '[plot_format, openmath]')
    321321
    322322Следующий график — это знаменитая Бутылка Клейна (не вводите ``...``):
    323323
     
    330330    -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)
    331331    sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))")
    332332    5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y))
    333     sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\
    334     ...   "[y, -%pi, %pi]", "['grid, 40, 40]",\
    335     ...   '[plot_format, openmath]') # not tested
     333    sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested
     334    ...   "[y, -%pi, %pi]", "['grid, 40, 40]",
     335    ...   '[plot_format, openmath]')
  • doc/ru/tutorial/programming.rst

    diff --git a/doc/ru/tutorial/programming.rst b/doc/ru/tutorial/programming.rst
    a b  
    576576::
    577577
    578578    >>> for i in range(5):
    579            print(i)
    580        
     579    ...     print(i)
     580    ...
    581581    0
    582582    1
    583583    2
     
    592592::
    593593
    594594    sage: for i in range(5):
    595     ...       print(i)  # нажмите Enter дважды
     595    ....:     print(i)  # нажмите Enter дважды
     596    ....:
    596597    0
    597598    1
    598599    2
  • sage/all.py

    diff --git a/sage/all.py b/sage/all.py
    a b  
    1414        sage: import inspect
    1515        sage: from sage import *
    1616        sage: frames=[x for x in gc.get_objects() if inspect.isframe(x)]
    17         sage: len(frames)
    18         11
    19    
     17
     18    We exclude the known files and check to see that there are no others::
     19
     20        sage: import os
     21        sage: allowed = [os.path.join("lib","python","threading.py")]
     22        sage: allowed.append(os.path.join("lib","python","multiprocessing"))
     23        sage: allowed.append(os.path.join("sage","doctest"))
     24        sage: allowed.append(os.path.join("local","bin","sage-runtests"))
     25        sage: allowed.append(os.path.join("site-packages","IPython"))
     26        sage: allowed.append(os.path.join("local","bin","sage-ipython"))
     27        sage: allowed.append("<ipython console>")
     28        sage: allowed.append("<doctest sage.all[3]>")
     29        sage: allowed.append(os.path.join("sage","combinat","species","generating_series.py"))
     30        sage: for i in frames:
     31        ....:     filename, lineno, funcname, linelist, indx = inspect.getframeinfo(i)
     32        ....:     for nm in allowed:
     33        ....:         if nm in filename:
     34        ....:             break
     35        ....:     else:
     36        ....:         print filename
     37        ....:
    2038"""
    2139
    2240###############################################################################
  • sage/calculus/calculus.py

    diff --git a/sage/calculus/calculus.py b/sage/calculus/calculus.py
    a b  
    17401740        sage: sefms("x # 3") == SR(x != 3)
    17411741        True
    17421742        sage: solve([x != 5], x)
     1743        #0: solve_rat_ineq(ineq=x # 5)
    17431744        [[x - 5 != 0]]
    17441745        sage: solve([2*x==3, x != 5], x)
    17451746        [[x == (3/2), (-7/2) != 0]]
  • sage/calculus/test_sympy.py

    diff --git a/sage/calculus/test_sympy.py b/sage/calculus/test_sympy.py
    a b  
     1# -*- coding: utf-8 -*-
    12r"""
    23A Sample Session using SymPy
    34
     
    111112    sage: f = e.series(x, 0, 10); f
    112113    1 + 3*x**2/2 + 11*x**4/8 + 241*x**6/240 + 8651*x**8/13440 + O(x**10)
    113114
    114 And the pretty-printer::
     115And the pretty-printer.  Since unicode characters aren't working on
     116some archictures, we disable it::
    115117
     118    sage: from sympy.printing import pprint_use_unicode
     119    sage: prev_use = pprint_use_unicode(False)
    116120    sage: pprint(e)
    117            1   
    118         -------
    119            3   
    120         cos (x)
     121       1
     122    -------
     123       3
     124    cos (x)
     125
    121126    sage: pprint(f)
    122                2       4        6         8           
    123             3*x    11*x    241*x    8651*x           
    124         1 + ---- + ----- + ------ + ------- + O(x**10)
    125              2       8      240      13440           
     127           2       4        6         8
     128        3*x    11*x    241*x    8651*x
     129    1 + ---- + ----- + ------ + ------- + O(x**10)
     130         2       8      240      13440
     131    sage: pprint_use_unicode(prev_use)
     132    False
    126133
    127134And the functionality to convert from sympy format to Sage format::
    128135
  • sage/categories/groups.py

    diff --git a/sage/categories/groups.py b/sage/categories/groups.py
    a b  
    4444        return [Monoids()]
    4545
    4646    def example(self):
    47         from sage.rings.rational_field import QQ 
    48         from sage.groups.matrix_gps.general_linear import GL
    4947        """
    5048        EXAMPLES::
    5149
    5250            sage: Groups().example()
    5351            General Linear Group of degree 4 over Rational Field
    5452        """
     53        from sage.rings.rational_field import QQ
     54        from sage.groups.matrix_gps.general_linear import GL
    5555        return GL(4,QQ)
    5656
    5757    class ParentMethods:
    5858
    5959        def group_generators(self):
    60             from sage.sets.family import Family
    6160            """
    6261            Returns group generators for self.
    6362
     
    7069                sage: A.group_generators()
    7170                Family ((2,3,4), (1,2,3))
    7271            """
     72            from sage.sets.family import Family
    7373            return Family(self.gens())
    7474
    7575        def _test_inverse(self, **options):
  • sage/categories/semigroups.py

    diff --git a/sage/categories/semigroups.py b/sage/categories/semigroups.py
    a b  
    441441
    442442            @cached_method
    443443            def algebra_generators(self):
    444                 from sage.sets.family import Family
    445444                r"""
    446445                The generators of this algebra, as per
    447446                :meth:`Algebras.ParentMethods.algebra_generators()
     
    455454                    sage: A.algebra_generators()
    456455                    Finite family {0: B['a'], 1: B['b'], 2: B['c'], 3: B['d']}
    457456                """
     457                from sage.sets.family import Family
    458458                return self.basis().keys().semigroup_generators().map(self.monomial)
    459459
    460460            def product_on_basis(self, g1, g2):
  • sage/categories/sets_cat.py

    diff --git a/sage/categories/sets_cat.py b/sage/categories/sets_cat.py
    a b  
    12461246                """
    12471247                return self._realizations
    12481248
    1249             facade_for = realizations
    1250             """
    1251             Returns the parents ``self`` is a facade for, that is
    1252             the realizations of ``self``
     1249            def facade_for(self):
     1250                """
     1251                Returns the parents ``self`` is a facade for, that is
     1252                the realizations of ``self``
    12531253
    1254             EXAMPLES::
     1254                EXAMPLES::
    12551255
    1256                 sage: A = Sets().WithRealizations().example(); A
    1257                 The subset algebra of {1, 2, 3} over Rational Field
    1258                 sage: A.facade_for()
    1259                 [The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis, The subset algebra of {1, 2, 3} over Rational Field in the In basis, The subset algebra of {1, 2, 3} over Rational Field in the Out basis]
     1256                    sage: A = Sets().WithRealizations().example(); A
     1257                    The subset algebra of {1, 2, 3} over Rational Field
     1258                    sage: A.facade_for()
     1259                    [The subset algebra of {1, 2, 3} over Rational Field in the Fundamental basis, The subset algebra of {1, 2, 3} over Rational Field in the In basis, The subset algebra of {1, 2, 3} over Rational Field in the Out basis]
    12601260
    1261                 sage: A = Sets().WithRealizations().example(); A
    1262                 The subset algebra of {1, 2, 3} over Rational Field
    1263                 sage: f = A.F().an_element(); f
    1264                 F[{}] + 2*F[{1}] + 3*F[{2}] + F[{1, 2}]
    1265                 sage: i = A.In().an_element(); i
    1266                 In[{}] + 2*In[{1}] + 3*In[{2}] + In[{1, 2}]
    1267                 sage: o = A.Out().an_element(); o
    1268                 Out[{}] + 2*Out[{1}] + 3*Out[{2}] + Out[{1, 2}]
    1269                 sage: f in A, i in A, o in A
    1270                 (True, True, True)
    1271             """
     1261                    sage: A = Sets().WithRealizations().example(); A
     1262                    The subset algebra of {1, 2, 3} over Rational Field
     1263                    sage: f = A.F().an_element(); f
     1264                    F[{}] + 2*F[{1}] + 3*F[{2}] + F[{1, 2}]
     1265                    sage: i = A.In().an_element(); i
     1266                    In[{}] + 2*In[{1}] + 3*In[{2}] + In[{1, 2}]
     1267                    sage: o = A.Out().an_element(); o
     1268                    Out[{}] + 2*Out[{1}] + 3*Out[{2}] + Out[{1, 2}]
     1269                    sage: f in A, i in A, o in A
     1270                    (True, True, True)
     1271                """
     1272                return self.realizations()
    12721273
    12731274            # Do we really want this feature?
    12741275            class Realizations(Category_realization_of_parent):
  • sage/combinat/crystals/direct_sum.py

    diff --git a/sage/combinat/crystals/direct_sum.py b/sage/combinat/crystals/direct_sum.py
    a b  
    6565        (0, 1)
    6666        sage: b.weight()
    6767        (1, 0, 0)
    68     """
    6968
    70     r"""
    7169    The following is required, because :class:`DirectSumOfCrystals`
    7270    takes the same arguments as :class:`DisjointUnionEnumeratedSets`
    7371    (which see for details).
  • sage/combinat/free_module.py

    diff --git a/sage/combinat/free_module.py b/sage/combinat/free_module.py
    a b  
    147147            sage: F.print_options(monomial_cmp = lambda x,y: -cmp(x,y))
    148148            sage: f._sorted_items_for_printing()
    149149            [('c', 2), ('b', 3), ('a', 1)]
     150            sage: F.print_options(monomial_cmp=cmp) #reset to original state
    150151
    151152        .. seealso:: :meth:`_repr_`, :meth:`_latex_`, :meth:`print_options`
    152153        """
     
    10481049        sage: F4.prefix()
    10491050        'F'
    10501051
     1052        sage: F2.print_options(prefix='F') #reset for following doctests
     1053
    10511054    The default category is the category of modules with basis over
    10521055    the base ring::
    10531056
     
    10631066    Customizing print and LaTeX representations of elements::
    10641067
    10651068        sage: F = CombinatorialFreeModule(QQ, ['a','b'], prefix='x')
     1069        sage: original_print_options = F.print_options()
    10661070        sage: e = F.basis()
    10671071        sage: e['a'] - 3 * e['b']
    10681072        x['a'] - 3*x['b']
     
    11171121        sage: tensor([f, g])
    11181122        2*x[1] # y[3] + x[1] # y[4] + 4*x[2] # y[3] + 2*x[2] # y[4]
    11191123
     1124        sage: F.print_options(**original_print_options) # reset print options
    11201125    """
    11211126
    11221127    @staticmethod
     
    16731678
    16741679            sage: sorted(F.print_options().items())
    16751680            [('bracket', '('), ('latex_bracket', False), ('latex_prefix', None), ('latex_scalar_mult', None), ('monomial_cmp', <built-in function cmp>), ('prefix', 'x'), ('scalar_mult', '*'), ('tensor_symbol', None)]
    1676 
     1681            sage: F.print_options(bracket='[') # reset
    16771682        """
    16781683        # don't just use kwds.get(...) because I want to distinguish
    16791684        # between an argument like "option=None" and the option not
     
    17281733            F['a'] + 2*F['b']
    17291734
    17301735            sage: QS3 = CombinatorialFreeModule(QQ, Permutations(3), prefix="")
     1736            sage: original_print_options = QS3.print_options()
    17311737            sage: a = 2*QS3([1,2,3])+4*QS3([3,2,1])
    17321738            sage: a                      # indirect doctest
    17331739            2*[[1, 2, 3]] + 4*[[3, 2, 1]]
     
    17441750            sage: a              # indirect doctest
    17451751            2 *@* |[1, 2, 3]| + 4 *@* |[3, 2, 1]|
    17461752
     1753            sage: QS3.print_options(**original_print_options) # reset
     1754
    17471755        TESTS::
    17481756
    17491757            sage: F = CombinatorialFreeModule(QQ, [('a', 'b'), ('c','d')])
     
    18051813            C_{a} + 2C_{b}
    18061814
    18071815            sage: QS3 = CombinatorialFreeModule(QQ, Permutations(3), prefix="", scalar_mult="*")
     1816            sage: original_print_options = QS3.print_options()
    18081817            sage: a = 2*QS3([1,2,3])+4*QS3([3,2,1])
    18091818            sage: latex(a)                     # indirect doctest
    18101819            2[1, 2, 3] + 4[3, 2, 1]
     
    18171826            sage: QS3.print_options(latex_bracket=('\\myleftbracket', '\\myrightbracket'))
    18181827            sage: latex(a)                     # indirect doctest
    18191828            2\myleftbracket[1, 2, 3]\myrightbracket + 4\myleftbracket[3, 2, 1]\myrightbracket
     1829            sage: QS3.print_options(**original_print_options) # reset
    18201830
    18211831        TESTS::
    18221832
  • sage/combinat/partition_algebra.py

    diff --git a/sage/combinat/partition_algebra.py b/sage/combinat/partition_algebra.py
    a b  
    5151#A_k#
    5252#####
    5353SetPartitionsAk = functools.partial(create_set_partition_function,"A")
    54 SetPartitionsAk.__doc__ = """
    55 Returns the combinatorial class of set partitions of type A_k.
     54SetPartitionsAk.__doc__ = (
     55    """
     56    Returns the combinatorial class of set partitions of type A_k.
    5657
    57 EXAMPLES::
     58    EXAMPLES::
    5859
    59     sage: A3 = SetPartitionsAk(3); A3
    60     Set partitions of {1, ..., 3, -1, ..., -3}
     60        sage: A3 = SetPartitionsAk(3); A3
     61        Set partitions of {1, ..., 3, -1, ..., -3}
    6162
    62     sage: A3.first() #random
    63     {{1, 2, 3, -1, -3, -2}}
    64     sage: A3.last() #random
    65     {{-1}, {-2}, {3}, {1}, {-3}, {2}}
    66     sage: A3.random_element()  #random
    67     {{1, 3, -3, -1}, {2, -2}}
     63        sage: A3.first() #random
     64        {{1, 2, 3, -1, -3, -2}}
     65        sage: A3.last() #random
     66        {{-1}, {-2}, {3}, {1}, {-3}, {2}}
     67        sage: A3.random_element()  #random
     68        {{1, 3, -3, -1}, {2, -2}}
    6869
    69     sage: A3.cardinality()
    70     203
     70        sage: A3.cardinality()
     71        203
    7172
    72     sage: A2p5 = SetPartitionsAk(2.5); A2p5
    73     Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block
    74     sage: A2p5.cardinality()
    75     52
     73        sage: A2p5 = SetPartitionsAk(2.5); A2p5
     74        Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block
     75        sage: A2p5.cardinality()
     76        52
    7677
    77     sage: A2p5.first() #random
    78     {{1, 2, 3, -1, -3, -2}}
    79     sage: A2p5.last() #random
    80     {{-1}, {-2}, {2}, {3, -3}, {1}}
    81     sage: A2p5.random_element() #random
    82     {{-1}, {-2}, {3, -3}, {1, 2}}
    83    
    84 """
     78        sage: A2p5.first() #random
     79        {{1, 2, 3, -1, -3, -2}}
     80        sage: A2p5.last() #random
     81        {{-1}, {-2}, {2}, {3, -3}, {1}}
     82        sage: A2p5.random_element() #random
     83        {{-1}, {-2}, {3, -3}, {1, 2}}
     84
     85    """)
    8586
    8687class SetPartitionsAk_k(set_partition.SetPartitions_set):
    8788    def __init__(self, k):
     
    195196#S_k#
    196197#####
    197198SetPartitionsSk = functools.partial(create_set_partition_function,"S")
    198 SetPartitionsSk.__doc__ = """
    199 Returns the combinatorial class of set partitions of type S_k.  There
    200 is a bijection between these set partitions and the permutations
    201 of 1, ..., k.
     199SetPartitionsSk.__doc__ = (
     200    """
     201    Returns the combinatorial class of set partitions of type S_k.  There
     202    is a bijection between these set partitions and the permutations
     203    of 1, ..., k.
    202204
    203 EXAMPLES::
     205    EXAMPLES::
    204206
    205     sage: S3 = SetPartitionsSk(3); S3
    206     Set partitions of {1, ..., 3, -1, ..., -3} with propagating number 3
    207     sage: S3.cardinality()
    208     6
     207        sage: S3 = SetPartitionsSk(3); S3
     208        Set partitions of {1, ..., 3, -1, ..., -3} with propagating number 3
     209        sage: S3.cardinality()
     210        6
    209211
    210     sage: S3.list()  #random
    211     [{{2, -2}, {3, -3}, {1, -1}},
    212      {{1, -1}, {2, -3}, {3, -2}},
    213      {{2, -1}, {3, -3}, {1, -2}},
    214      {{1, -2}, {2, -3}, {3, -1}},
    215      {{1, -3}, {2, -1}, {3, -2}},
    216      {{1, -3}, {2, -2}, {3, -1}}]
    217     sage: S3.first() #random
    218     {{2, -2}, {3, -3}, {1, -1}}
    219     sage: S3.last() #random
    220     {{1, -3}, {2, -2}, {3, -1}}
    221     sage: S3.random_element() #random
    222     {{1, -3}, {2, -1}, {3, -2}}
     212        sage: S3.list()  #random
     213        [{{2, -2}, {3, -3}, {1, -1}},
     214         {{1, -1}, {2, -3}, {3, -2}},
     215         {{2, -1}, {3, -3}, {1, -2}},
     216         {{1, -2}, {2, -3}, {3, -1}},
     217         {{1, -3}, {2, -1}, {3, -2}},
     218         {{1, -3}, {2, -2}, {3, -1}}]
     219        sage: S3.first() #random
     220        {{2, -2}, {3, -3}, {1, -1}}
     221        sage: S3.last() #random
     222        {{1, -3}, {2, -2}, {3, -1}}
     223        sage: S3.random_element() #random
     224        {{1, -3}, {2, -1}, {3, -2}}
    223225
    224     sage: S3p5 = SetPartitionsSk(3.5); S3p5
    225     Set partitions of {1, ..., 4, -1, ..., -4} with 4 and -4 in the same block and propagating number 4
    226     sage: S3p5.cardinality()
    227     6
     226        sage: S3p5 = SetPartitionsSk(3.5); S3p5
     227        Set partitions of {1, ..., 4, -1, ..., -4} with 4 and -4 in the same block and propagating number 4
     228        sage: S3p5.cardinality()
     229        6
    228230
    229     sage: S3p5.list() #random
    230     [{{2, -2}, {3, -3}, {1, -1}, {4, -4}},
    231      {{2, -3}, {1, -1}, {4, -4}, {3, -2}},
    232      {{2, -1}, {3, -3}, {1, -2}, {4, -4}},
    233      {{2, -3}, {1, -2}, {4, -4}, {3, -1}},
    234      {{1, -3}, {2, -1}, {4, -4}, {3, -2}},
    235      {{1, -3}, {2, -2}, {4, -4}, {3, -1}}]
    236     sage: S3p5.first() #random
    237     {{2, -2}, {3, -3}, {1, -1}, {4, -4}}
    238     sage: S3p5.last() #random
    239     {{1, -3}, {2, -2}, {4, -4}, {3, -1}}
    240     sage: S3p5.random_element() #random
    241     {{1, -3}, {2, -2}, {4, -4}, {3, -1}}
    242 """
     231        sage: S3p5.list() #random
     232        [{{2, -2}, {3, -3}, {1, -1}, {4, -4}},
     233         {{2, -3}, {1, -1}, {4, -4}, {3, -2}},
     234         {{2, -1}, {3, -3}, {1, -2}, {4, -4}},
     235         {{2, -3}, {1, -2}, {4, -4}, {3, -1}},
     236         {{1, -3}, {2, -1}, {4, -4}, {3, -2}},
     237         {{1, -3}, {2, -2}, {4, -4}, {3, -1}}]
     238        sage: S3p5.first() #random
     239        {{2, -2}, {3, -3}, {1, -1}, {4, -4}}
     240        sage: S3p5.last() #random
     241        {{1, -3}, {2, -2}, {4, -4}, {3, -1}}
     242        sage: S3p5.random_element() #random
     243        {{1, -3}, {2, -2}, {4, -4}, {3, -1}}
     244    """)
    243245class SetPartitionsSk_k(SetPartitionsAk_k):
    244246    def __repr__(self):
    245247        """
     
    384386#I_k#
    385387#####
    386388SetPartitionsIk = functools.partial(create_set_partition_function,"I")
    387 SetPartitionsIk.__doc__ = """
    388 Returns the combinatorial class of set partitions of type I_k.  These
    389 are set partitions with a propagating number of less than k.  Note
    390 that the identity set partition {{1, -1}, ..., {k, -k}} is not
    391 in I_k.
     389SetPartitionsIk.__doc__ = (
     390    """
     391    Returns the combinatorial class of set partitions of type I_k.  These
     392    are set partitions with a propagating number of less than k.  Note
     393    that the identity set partition {{1, -1}, ..., {k, -k}} is not
     394    in I_k.
    392395
    393 EXAMPLES::
     396    EXAMPLES::
    394397
    395     sage: I3 = SetPartitionsIk(3); I3
    396     Set partitions of {1, ..., 3, -1, ..., -3} with propagating number < 3
    397     sage: I3.cardinality()
    398     197
     398        sage: I3 = SetPartitionsIk(3); I3
     399        Set partitions of {1, ..., 3, -1, ..., -3} with propagating number < 3
     400        sage: I3.cardinality()
     401        197
    399402
    400     sage: I3.first() #random
    401     {{1, 2, 3, -1, -3, -2}}
    402     sage: I3.last() #random
    403     {{-1}, {-2}, {3}, {1}, {-3}, {2}}
    404     sage: I3.random_element() #random
    405     {{-1}, {-3, -2}, {2, 3}, {1}}
     403        sage: I3.first() #random
     404        {{1, 2, 3, -1, -3, -2}}
     405        sage: I3.last() #random
     406        {{-1}, {-2}, {3}, {1}, {-3}, {2}}
     407        sage: I3.random_element() #random
     408        {{-1}, {-3, -2}, {2, 3}, {1}}
    406409
    407     sage: I2p5 = SetPartitionsIk(2.5); I2p5
    408     Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and propagating number < 3
    409     sage: I2p5.cardinality()
    410     50
     410        sage: I2p5 = SetPartitionsIk(2.5); I2p5
     411        Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and propagating number < 3
     412        sage: I2p5.cardinality()
     413        50
    411414
    412     sage: I2p5.first() #random
    413     {{1, 2, 3, -1, -3, -2}}
    414     sage: I2p5.last() #random
    415     {{-1}, {-2}, {2}, {3, -3}, {1}}
    416     sage: I2p5.random_element() #random
    417     {{-1}, {-2}, {1, 3, -3}, {2}}
     415        sage: I2p5.first() #random
     416        {{1, 2, 3, -1, -3, -2}}
     417        sage: I2p5.last() #random
     418        {{-1}, {-2}, {2}, {3, -3}, {1}}
     419        sage: I2p5.random_element() #random
     420        {{-1}, {-2}, {1, 3, -3}, {2}}
    418421
    419 """
     422    """)
    420423class SetPartitionsIk_k(SetPartitionsAk_k):
    421424    def __repr__(self):
    422425        """
     
    538541#B_k#
    539542#####
    540543SetPartitionsBk = functools.partial(create_set_partition_function,"B")
    541 SetPartitionsBk.__doc__ = """
    542 Returns the combinatorial class of set partitions of type B_k.
    543 These are the set partitions where every block has size 2.
     544SetPartitionsBk.__doc__ = (
     545    """
     546    Returns the combinatorial class of set partitions of type B_k.
     547    These are the set partitions where every block has size 2.
    544548
    545 EXAMPLES::
     549    EXAMPLES::
    546550
    547     sage: B3 = SetPartitionsBk(3); B3
    548     Set partitions of {1, ..., 3, -1, ..., -3} with block size 2
     551        sage: B3 = SetPartitionsBk(3); B3
     552        Set partitions of {1, ..., 3, -1, ..., -3} with block size 2
    549553
    550     sage: B3.first() #random
    551     {{2, -2}, {1, -3}, {3, -1}}
    552     sage: B3.last() #random
    553     {{1, 2}, {3, -2}, {-3, -1}}
    554     sage: B3.random_element() #random
    555     {{2, -1}, {1, -3}, {3, -2}}
     554        sage: B3.first() #random
     555        {{2, -2}, {1, -3}, {3, -1}}
     556        sage: B3.last() #random
     557        {{1, 2}, {3, -2}, {-3, -1}}
     558        sage: B3.random_element() #random
     559        {{2, -1}, {1, -3}, {3, -2}}
    556560
    557     sage: B3.cardinality()
    558     15
     561        sage: B3.cardinality()
     562        15
    559563
    560     sage: B2p5 = SetPartitionsBk(2.5); B2p5
    561     Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2
     564        sage: B2p5 = SetPartitionsBk(2.5); B2p5
     565        Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2
    562566
    563     sage: B2p5.first() #random
    564     {{2, -1}, {3, -3}, {1, -2}}
    565     sage: B2p5.last() #random
    566     {{1, 2}, {3, -3}, {-1, -2}}
    567     sage: B2p5.random_element() #random
    568     {{2, -2}, {3, -3}, {1, -1}}
     567        sage: B2p5.first() #random
     568        {{2, -1}, {3, -3}, {1, -2}}
     569        sage: B2p5.last() #random
     570        {{1, 2}, {3, -3}, {-1, -2}}
     571        sage: B2p5.random_element() #random
     572        {{2, -2}, {3, -3}, {1, -1}}
    569573
    570     sage: B2p5.cardinality()
    571     3
    572 """
     574        sage: B2p5.cardinality()
     575        3
     576    """)
    573577
    574578class SetPartitionsBk_k(SetPartitionsAk_k):
    575579    def __repr__(self):
     
    740744#P_k#
    741745#####
    742746SetPartitionsPk = functools.partial(create_set_partition_function,"P")
    743 SetPartitionsPk.__doc__ = """
    744 Returns the combinatorial class of set partitions of type P_k.
    745 These are the planar set partitions.
     747SetPartitionsPk.__doc__ = (
     748    """
     749    Returns the combinatorial class of set partitions of type P_k.
     750    These are the planar set partitions.
    746751
    747 EXAMPLES::
     752    EXAMPLES::
    748753
    749     sage: P3 = SetPartitionsPk(3); P3
    750     Set partitions of {1, ..., 3, -1, ..., -3} that are planar
    751     sage: P3.cardinality()
    752     132
     754        sage: P3 = SetPartitionsPk(3); P3
     755        Set partitions of {1, ..., 3, -1, ..., -3} that are planar
     756        sage: P3.cardinality()
     757        132
    753758
    754     sage: P3.first() #random
    755     {{1, 2, 3, -1, -3, -2}}
    756     sage: P3.last() #random
    757     {{-1}, {-2}, {3}, {1}, {-3}, {2}}
    758     sage: P3.random_element() #random
    759     {{1, 2, -1}, {-3}, {3, -2}}
     759        sage: P3.first() #random
     760        {{1, 2, 3, -1, -3, -2}}
     761        sage: P3.last() #random
     762        {{-1}, {-2}, {3}, {1}, {-3}, {2}}
     763        sage: P3.random_element() #random
     764        {{1, 2, -1}, {-3}, {3, -2}}
    760765
    761     sage: P2p5 = SetPartitionsPk(2.5); P2p5
    762     Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and that are planar
    763     sage: P2p5.cardinality()
    764     42
     766        sage: P2p5 = SetPartitionsPk(2.5); P2p5
     767        Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and that are planar
     768        sage: P2p5.cardinality()
     769        42
    765770
    766     sage: P2p5.first() #random
    767     {{1, 2, 3, -1, -3, -2}}
    768     sage: P2p5.last() #random
    769     {{-1}, {-2}, {2}, {3, -3}, {1}}
    770     sage: P2p5.random_element() #random
    771     {{1, 2, 3, -3}, {-1, -2}}
     771        sage: P2p5.first() #random
     772        {{1, 2, 3, -1, -3, -2}}
     773        sage: P2p5.last() #random
     774        {{-1}, {-2}, {2}, {3, -3}, {1}}
     775        sage: P2p5.random_element() #random
     776        {{1, 2, 3, -3}, {-1, -2}}
    772777
    773 """
     778    """)
    774779class SetPartitionsPk_k(SetPartitionsAk_k):
    775780    def __repr__(self):
    776781        """
     
    900905#T_k#
    901906#####
    902907SetPartitionsTk = functools.partial(create_set_partition_function,"T")
    903 SetPartitionsTk.__doc__ = """
    904 Returns the combinatorial class of set partitions of type T_k.
    905 These are planar set partitions where every block is of size 2.
     908SetPartitionsTk.__doc__ = (
     909    """
     910    Returns the combinatorial class of set partitions of type T_k.
     911    These are planar set partitions where every block is of size 2.
    906912
    907 EXAMPLES::
     913    EXAMPLES::
    908914
    909     sage: T3 = SetPartitionsTk(3); T3
    910     Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 and that are planar
    911     sage: T3.cardinality()
    912     5
     915        sage: T3 = SetPartitionsTk(3); T3
     916        Set partitions of {1, ..., 3, -1, ..., -3} with block size 2 and that are planar
     917        sage: T3.cardinality()
     918        5
    913919
    914     sage: T3.first() #random
    915     {{1, -3}, {2, 3}, {-1, -2}}
    916     sage: T3.last() #random
    917     {{1, 2}, {3, -1}, {-3, -2}}
    918     sage: T3.random_element() #random
    919     {{1, -3}, {2, 3}, {-1, -2}}
     920        sage: T3.first() #random
     921        {{1, -3}, {2, 3}, {-1, -2}}
     922        sage: T3.last() #random
     923        {{1, 2}, {3, -1}, {-3, -2}}
     924        sage: T3.random_element() #random
     925        {{1, -3}, {2, 3}, {-1, -2}}
    920926
    921     sage: T2p5 = SetPartitionsTk(2.5); T2p5
    922     Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 and that are planar
    923     sage: T2p5.cardinality()
    924     2
     927        sage: T2p5 = SetPartitionsTk(2.5); T2p5
     928        Set partitions of {1, ..., 3, -1, ..., -3} with 3 and -3 in the same block and with block size 2 and that are planar
     929        sage: T2p5.cardinality()
     930        2
    925931
    926     sage: T2p5.first() #random
    927     {{2, -2}, {3, -3}, {1, -1}}
    928     sage: T2p5.last() #random
    929     {{1, 2}, {3, -3}, {-1, -2}}
     932        sage: T2p5.first() #random
     933        {{2, -2}, {3, -3}, {1, -1}}
     934        sage: T2p5.last() #random
     935        {{1, 2}, {3, -3}, {-1, -2}}
    930936
    931 """
     937    """)
    932938class SetPartitionsTk_k(SetPartitionsBk_k):
    933939    def __repr__(self):
    934940        """
     
    10511057
    10521058
    10531059SetPartitionsRk = functools.partial(create_set_partition_function,"R")
    1054 SetPartitionsRk.__doc__ = """
    1055 """
     1060SetPartitionsRk.__doc__ = (
     1061    """
     1062    """)
    10561063class SetPartitionsRk_k(SetPartitionsAk_k):
    10571064    def __init__(self, k):
    10581065        """
     
    12321239
    12331240
    12341241SetPartitionsPRk = functools.partial(create_set_partition_function,"PR")
    1235 SetPartitionsPRk.__doc__ = """
    1236 """
     1242SetPartitionsPRk.__doc__ = (
     1243    """
     1244    """)
    12371245class SetPartitionsPRk_k(SetPartitionsRk_k):
    12381246    def __init__(self, k):
    12391247        """
  • sage/functions/hyperbolic.py

    diff --git a/sage/functions/hyperbolic.py b/sage/functions/hyperbolic.py
    a b  
    608608            sage: import numpy
    609609            sage: a = numpy.linspace(0,1,3)
    610610            sage: arcsech(a)
     611            Warning: divide by zero encountered in divide
    611612            array([       inf,  1.3169579,  0.       ])
    612613        """
    613614        return arccosh(1.0 / x)
     
    657658            sage: import numpy
    658659            sage: a = numpy.linspace(0,1,3)
    659660            sage: arccsch(a)
     661            Warning: divide by zero encountered in divide
    660662            array([        inf,  1.44363548,  0.88137359])
    661663        """
    662664        return arcsinh(1.0 / x)
  • sage/interfaces/tachyon.py

    diff --git a/sage/interfaces/tachyon.py b/sage/interfaces/tachyon.py
    a b  
    66- John E. Stone
    77"""
    88
     9#*****************************************************************************
     10#       Copyright (C) 2006 John E. Stone
     11#
     12#  Distributed under the terms of the GNU General Public License (GPL)
     13#  as published by the Free Software Foundation; either version 2 of
     14#  the License, or (at your option) any later version.
     15#                  http://www.gnu.org/licenses/
     16#*****************************************************************************
    917
    1018from sage.misc.pager import pager
    1119from sage.misc.misc import tmp_filename
    1220from sage.misc.sagedoc import format
    1321import os
     22import sys
    1423
    1524class TachyonRT:
    1625    """
     
    98107            sage: import os
    99108            sage: t(tgen.str(), outfile = os.devnull)
    100109            tachyon ...
     110            Tachyon Parallel/Multiprocessor Ray Tracer...
    101111        """
    102112        modelfile = tmp_filename(ext='.dat')
    103113        open(modelfile,'w').write(model)
     
    130140
    131141        if verbose:
    132142            print cmd
     143        # One should always flush before system()
     144        sys.stdout.flush()
     145        sys.stderr.flush()
    133146        os.system(cmd)
    134147
    135148    def usage(self, use_pager=True):
  • sage/lfunctions/lcalc.py

    diff --git a/sage/lfunctions/lcalc.py b/sage/lfunctions/lcalc.py
    a b  
    119119            sage: lcalc.zeros(5, L='--tau')                # long time
    120120            [9.22237940, 13.9075499, 17.4427770, 19.6565131, 22.3361036]
    121121            sage: lcalc.zeros(3, EllipticCurve('37a'))     # long time
     122              ***   Warning: new stack size = ...
    122123            [0.000000000, 5.00317001, 6.87039122]
    123124        """
    124125        L = self._compute_L(L)
     
    228229       
    229230            sage: E = EllipticCurve('389a')
    230231            sage: E.lseries().values_along_line(0.5, 3, 5)
     232              ***   Warning: new stack size = ...
    231233            [(0.000000000, 0.209951303),
    232234             (0.500000000, -...e-16),
    233235             (1.00000000, 0.133768433),
     
    373375       
    374376            sage: E = EllipticCurve('37a')
    375377            sage: lcalc.analytic_rank(E)
     378              ***   Warning: new stack size = ...
    376379            1
    377380        """
    378381        L = self._compute_L(L)       
  • sage/libs/lcalc/lcalc_Lfunction.pyx

    diff --git a/sage/libs/lcalc/lcalc_Lfunction.pyx b/sage/libs/lcalc/lcalc_Lfunction.pyx
    a b  
    401401            sage: from sage.libs.lcalc.lcalc_Lfunction import *
    402402            sage: chi=DirichletGroup(5)[2] #This is a quadratic character
    403403            sage: L=Lfunction_from_character(chi, type="int")
    404             sage: L._print_data_to_standard_output()
     404            sage: L._print_data_to_standard_output() # tol 1e-15
     405            -----------------------------------------------
     406            <BLANKLINE>
     407            Name of L_function:
     408            number of dirichlet coefficients = 5
     409            coefficients are periodic
     410            b[1] = 1
     411            b[2] = -1
     412            b[3] = -1
     413            b[4] = 1
     414            b[5] = 0
     415            <BLANKLINE>
     416            Q = 1.26156626101
     417            OMEGA = (1,0)
     418            a = 1 (the quasi degree)
     419            gamma[1] =0.5    lambda[1] =(0,0)
     420            <BLANKLINE>
     421            <BLANKLINE>
     422            number of poles (of the completed L function) = 0
     423            -----------------------------------------------
     424            <BLANKLINE>
    405425        """
    406426        (<c_Lfunction_I *>self.thisptr).print_data_L()
    407427
     
    509529            sage: from sage.libs.lcalc.lcalc_Lfunction import *
    510530            sage: chi=DirichletGroup(5)[2] #This is a quadratic character
    511531            sage: L=Lfunction_from_character(chi, type="double")
    512             sage: L._print_data_to_standard_output()
     532            sage: L._print_data_to_standard_output() # tol 1e-15
     533            -----------------------------------------------
     534            <BLANKLINE>
     535            Name of L_function:
     536            number of dirichlet coefficients = 5
     537            coefficients are periodic
     538            b[1] = 1
     539            b[2] = -1
     540            b[3] = -1
     541            b[4] = 1
     542            b[5] = 0
     543            <BLANKLINE>
     544            Q = 1.26156626101
     545            OMEGA = (1,0)
     546            a = 1 (the quasi degree)
     547            gamma[1] =0.5    lambda[1] =(0,0)
     548            <BLANKLINE>
     549            <BLANKLINE>
     550            number of poles (of the completed L function) = 0
     551            -----------------------------------------------
     552            <BLANKLINE>
     553
    513554        """
    514555        (<c_Lfunction_D *>self.thisptr).print_data_L()
    515556
     
    622663            sage: from sage.libs.lcalc.lcalc_Lfunction import *
    623664            sage: chi=DirichletGroup(5)[1]
    624665            sage: L=Lfunction_from_character(chi, type="complex")
    625             sage: L._print_data_to_standard_output()
     666            sage: L._print_data_to_standard_output() # tol 1e-15
     667            -----------------------------------------------
     668            <BLANKLINE>
     669            Name of L_function:
     670            number of dirichlet coefficients = 5
     671            coefficients are periodic
     672            b[1] = (1,0)
     673            b[2] = (0,1)
     674            b[3] = (0,-1)
     675            b[4] = (-1,0)
     676            b[5] = (0,0)
     677            <BLANKLINE>
     678            Q = 1.26156626101
     679            OMEGA = (0.850650808352,0.525731112119)
     680            a = 1 (the quasi degree)
     681            gamma[1] =0.5    lambda[1] =(0.5,0)
     682            <BLANKLINE>
     683            <BLANKLINE>
     684            number of poles (of the completed L function) = 0
     685            -----------------------------------------------
     686            <BLANKLINE>
     687
    626688
    627689        """
    628690        (<c_Lfunction_C *>self.thisptr).print_data_L()
  • sage/libs/mpmath/ext_main.pyx

    diff --git a/sage/libs/mpmath/ext_main.pyx b/sage/libs/mpmath/ext_main.pyx
    a b  
    508508        Creates an mpc from tuple data ::
    509509
    510510            sage: import mpmath
    511             >>> complex(mpmath.mp.make_mpc(((0,1,-1,1), (1,1,-2,1))))
     511            sage: complex(mpmath.mp.make_mpc(((0,1,-1,1), (1,1,-2,1))))
    512512            (0.5-0.25j)
    513513        """
    514514        cdef mpc x
  • sage/libs/mwrank/interface.py

    diff --git a/sage/libs/mwrank/interface.py b/sage/libs/mwrank/interface.py
    a b  
    208208
    209209            sage: E = mwrank_EllipticCurve([0, 0, 1, -1, 0])
    210210            sage: E.set_verbose(1)
    211             sage: E.saturate() # produces the following output
    212 
    213         ::   
    214            
     211            sage: E.saturate() # tol 1e-14
    215212            Basic pair: I=48, J=-432
    216213            disc=255744
    217214            2-adic index bound = 2
     
    221218            Looking for quartics with I = 48, J = -432
    222219            Looking for Type 2 quartics:
    223220            Trying positive a from 1 up to 1 (square a first...)
    224             (1,0,-6,4,1)        --trivial
     221            (1,0,-6,4,1)        --trivial
    225222            Trying positive a from 1 up to 1 (...then non-square a)
    226223            Finished looking for Type 2 quartics.
    227224            Looking for Type 1 quartics:
    228225            Trying positive a from 1 up to 2 (square a first...)
    229             (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0)
     226            (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0)
    230227            Point = [0:0:1]
    231             height = 0.051111408239968840235886099756942021609538202280854
     228                height = 0.0511114082399688402358
    232229            Rank of B=im(eps) increases to 1 (The previous point is on the egg)
    233230            Exiting search for Type 1 quartics after finding one which is globally soluble.
    234231            Mordell rank contribution from B=im(eps) = 1
     
    238235            Selmer  rank contribution from A=ker(eps) = 0
    239236            Sha     rank contribution from A=ker(eps) = 0
    240237            Searching for points (bound = 8)...done:
    241             found points of rank 1
    242             and regulator 0.051111408239968840235886099756942021609538202280854
     238              found points which generate a subgroup of rank 1
     239              and regulator 0.0511114082399688402358
    243240            Processing points found during 2-descent...done:
    244             now regulator = 0.051111408239968840235886099756942021609538202280854
    245             Saturating (bound = -1)...done:
    246             points were already saturated.
     241              now regulator = 0.0511114082399688402358
     242            Saturating (with bound = -1)...done:
     243              points were already saturated.
    247244        """
    248245        self.__verbose = verbose
    249246
     
    376373        TESTS (see #7992)::   
    377374
    378375            sage: EllipticCurve([0, prod(prime_range(10))]).mwrank_curve().two_descent()
     376            Basic pair: I=0, J=-5670
     377            disc=-32148900
     378            2-adic index bound = 2
     379            2-adic index = 2
     380            Two (I,J) pairs
     381            Looking for quartics with I = 0, J = -5670
     382            Looking for Type 3 quartics:
     383            Trying positive a from 1 up to 5 (square a first...)
     384            Trying positive a from 1 up to 5 (...then non-square a)
     385            (2,0,-12,19,-6)     --nontrivial...(x:y:z) = (2 : 4 : 1)
     386            Point = [-2488:-4997:512]
     387                height = 6.46767239...
     388            Rank of B=im(eps) increases to 1
     389            Trying negative a from -1 down to -3
     390            Finished looking for Type 3 quartics.
     391            Looking for quartics with I = 0, J = -362880
     392            Looking for Type 3 quartics:
     393            Trying positive a from 1 up to 20 (square a first...)
     394            Trying positive a from 1 up to 20 (...then non-square a)
     395            Trying negative a from -1 down to -13
     396            Finished looking for Type 3 quartics.
     397            Mordell rank contribution from B=im(eps) = 1
     398            Selmer  rank contribution from B=im(eps) = 1
     399            Sha     rank contribution from B=im(eps) = 0
     400            Mordell rank contribution from A=ker(eps) = 0
     401            Selmer  rank contribution from A=ker(eps) = 0
     402            Sha     rank contribution from A=ker(eps) = 0
    379403            sage: EllipticCurve([0, prod(prime_range(100))]).mwrank_curve().two_descent()
    380404            Traceback (most recent call last):
    381405            ...
     
    739763        sage: EQ = mwrank_MordellWeil(E)
    740764        sage: EQ
    741765        Subgroup of Mordell-Weil group: []
    742         sage: EQ.search(2) # output below
    743 
    744     The previous command produces the following output::
    745            
     766        sage: EQ.search(2)
    746767        P1 = [0:1:0]     is torsion point, order 1
    747768        P1 = [1:-1:1]    is torsion point, order 2
    748769        P1 = [2:2:1]     is torsion point, order 3
     
    751772        sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    752773        sage: EQ = mwrank_MordellWeil(E)
    753774        sage: EQ.search(2)
     775        P1 = [0:1:0]     is torsion point, order 1
     776        P1 = [-3:0:1]     is generator number 1
     777        ...
     778        P4 = [-91:804:343]       = -2*P1 + 2*P2 + 1*P3 (mod torsion)
    754779        sage: EQ
    755780        Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]]
    756781
     
    758783
    759784        sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    760785        sage: EQ = mwrank_MordellWeil(E, verbose=False)
    761         sage: EQ.search(1) # no output
     786        sage: EQ.search(1)
    762787        sage: EQ
    763788        Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]]
    764789
    765790        sage: EQ = mwrank_MordellWeil(E, verbose=True)
    766         sage: EQ.search(1) # output below
    767 
    768     The previous command produces the following output::   
    769 
     791        sage: EQ.search(1)
    770792        P1 = [0:1:0]     is torsion point, order 1
    771793        P1 = [-3:0:1]     is generator number 1
    772794        saturating up to 20...Checking 2-saturation
     
    941963            [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]]
    942964            sage: EQ = mwrank_MordellWeil(E)
    943965            sage: EQ.process([[1, -1, 1], [-2, 3, 1], [-14, 25, 8]])
    944 
    945         Output of previous command::   
    946 
    947966            P1 = [1:-1:1]         is generator number 1
    948967            P2 = [-2:3:1]         is generator number 2
    949968            P3 = [-14:25:8]       is generator number 3
    950969
    951970        ::
    952            
     971
    953972            sage: EQ.points()
    954973            [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]]
    955974
     
    958977            sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    959978            sage: EQ = mwrank_MordellWeil(E)
    960979            sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=20)
     980            P1 = [1547:-2967:343]         is generator number 1
     981            ...
     982            Gained index 5, new generators = [ [-2:3:1] [-14:25:8] [1:-1:1] ]
     983
    961984            sage: EQ.points()
    962985            [[-2, 3, 1], [-14, 25, 8], [1, -1, 1]]
    963986
     
    967990            sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    968991            sage: EQ = mwrank_MordellWeil(E)
    969992            sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=0)
     993            P1 = [1547:-2967:343]         is generator number 1
     994            P2 = [2707496766203306:864581029138191:2969715140223272]      is generator number 2
     995            P3 = [-13422227300:-49322830557:12167000000]          is generator number 3
    970996            sage: EQ.points()
    971997            [[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]]
    972998            sage: EQ.regulator()
    973999            375.42919921875
    9741000            sage: EQ.saturate(2)  # points were not 2-saturated
     1001            saturating basis...Saturation index bound = 93
     1002            WARNING: saturation at primes p > 2 will not be done;
     1003            ...
     1004            Gained index 2
     1005            New regulator =  93.857300720636393209
    9751006            (False, 2, '[ ]')
    9761007            sage: EQ.points()
    9771008            [[-2, 3, 1], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]]
    9781009            sage: EQ.regulator()
    9791010            93.8572998046875
    9801011            sage: EQ.saturate(3)  # points were not 3-saturated
     1012            saturating basis...Saturation index bound = 46
     1013            WARNING: saturation at primes p > 3 will not be done;
     1014            ...
     1015            Gained index 3
     1016            New regulator =  10.4285889689595992455
    9811017            (False, 3, '[ ]')
    9821018            sage: EQ.points()
    9831019            [[-2, 3, 1], [-14, 25, 8], [-13422227300, -49322830557, 12167000000]]
    9841020            sage: EQ.regulator()
    9851021            10.4285888671875
    9861022            sage: EQ.saturate(5)  # points were not 5-saturated
     1023            saturating basis...Saturation index bound = 15
     1024            WARNING: saturation at primes p > 5 will not be done;
     1025            ...
     1026            Gained index 5
     1027            New regulator =  0.417143558758383969818
    9871028            (False, 5, '[ ]')
    9881029            sage: EQ.points()
    9891030            [[-2, 3, 1], [-14, 25, 8], [1, -1, 1]]
    9901031            sage: EQ.regulator()
    9911032            0.4171435534954071
    9921033            sage: EQ.saturate()   # points are now saturated
     1034            saturating basis...Saturation index bound = 3
     1035            Checking saturation at [ 2 3 ]
     1036            Checking 2-saturation
     1037            Points were proved 2-saturated (max q used = 11)
     1038            Checking 3-saturation
     1039            Points were proved 3-saturated (max q used = 13)
     1040            done
    9931041            (True, 1, '[ ]')
    9941042        """
    9951043        if not isinstance(v, list):
     
    10591107        Now we do a very small search::
    10601108           
    10611109            sage: EQ.search(1)
     1110            P1 = [0:1:0]         is torsion point, order 1
     1111            P1 = [-3:0:1]         is generator number 1
     1112            saturating up to 20...Checking 2-saturation
     1113            ...
     1114            P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion)
    10621115            sage: EQ
    10631116            Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]]
    10641117            sage: EQ.rank()
     
    11411194        ``sat`` to 0 (which is in fact the default)::
    11421195
    11431196            sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=0)
     1197            P1 = [1547:-2967:343]         is generator number 1
     1198            P2 = [2707496766203306:864581029138191:2969715140223272]      is generator number 2
     1199            P3 = [-13422227300:-49322830557:12167000000]          is generator number 3
    11441200            sage: EQ
    11451201            Subgroup of Mordell-Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]]
    11461202            sage: EQ.regulator()
     
    11491205        Now we saturate at `p=2`, and gain index 2::
    11501206
    11511207            sage: EQ.saturate(2)  # points were not 2-saturated
     1208            saturating basis...Saturation index bound = 93
     1209            WARNING: saturation at primes p > 2 will not be done;
     1210            ...
     1211            Gained index 2
     1212            New regulator =  93.857300720636393209
    11521213            (False, 2, '[ ]')
    11531214            sage: EQ
    11541215            Subgroup of Mordell-Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]]
     
    11581219        Now we saturate at `p=3`, and gain index 3::
    11591220
    11601221            sage: EQ.saturate(3)  # points were not 3-saturated
     1222            saturating basis...Saturation index bound = 46
     1223            WARNING: saturation at primes p > 3 will not be done;
     1224            ...
     1225            Gained index 3
     1226            New regulator =  10.4285889689595992455
    11611227            (False, 3, '[ ]')
    11621228            sage: EQ
    11631229            Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]]
     
    11671233        Now we saturate at `p=5`, and gain index 5::
    11681234
    11691235            sage: EQ.saturate(5)  # points were not 5-saturated
     1236            saturating basis...Saturation index bound = 15
     1237            WARNING: saturation at primes p > 5 will not be done;
     1238            ...
     1239            Gained index 5
     1240            New regulator =  0.417143558758383969818
    11701241            (False, 5, '[ ]')
    11711242            sage: EQ
    11721243            Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]]
     
    11771248        the points are now provably saturated at all primes::
    11781249
    11791250            sage: EQ.saturate()   # points are now saturated
     1251            saturating basis...Saturation index bound = 3
     1252            Checking saturation at [ 2 3 ]
     1253            Checking 2-saturation
     1254            Points were proved 2-saturated (max q used = 11)
     1255            Checking 3-saturation
     1256            Points were proved 3-saturated (max q used = 13)
     1257            done
    11801258            (True, 1, '[ ]')
    11811259
    11821260        Of course, the :meth:`process()` function would have done all this
     
    11851263            sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    11861264            sage: EQ = mwrank_MordellWeil(E)
    11871265            sage: EQ.process([[1547, -2967, 343], [2707496766203306, 864581029138191, 2969715140223272], [-13422227300, -49322830557, 12167000000]], sat=5)
     1266            P1 = [1547:-2967:343]         is generator number 1
     1267            ...
     1268            Gained index 5, new generators = [ [-2:3:1] [-14:25:8] [1:-1:1] ]
    11881269            sage: EQ
    11891270            Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]]
    11901271            sage: EQ.regulator()
     
    11941275        verify that full saturation has been done::
    11951276
    11961277            sage: EQ.saturate()
     1278            saturating basis...Saturation index bound = 3
     1279            Checking saturation at [ 2 3 ]
     1280            Checking 2-saturation
     1281            Points were proved 2-saturated (max q used = 11)
     1282            Checking 3-saturation
     1283            Points were proved 3-saturated (max q used = 13)
     1284            done
    11971285            (True, 1, '[ ]')
    11981286
    1199         The preceding command produces the following output as a
    1200         side-effect.  It proves that the index of the points in their
    1201         saturation is at most 3, then proves saturation at 2 and at 3,
    1202         by reducing the points modulo all primes of good reduction up
    1203         to 11, respectively 13::
    1204 
    1205             saturating basis...Saturation index bound = 3
    1206             Checking saturation at [ 2 3 ]
    1207             Checking 2-saturation
    1208             Points were proved 2-saturated (max q used = 11)
    1209             Checking 3-saturation
    1210             Points were proved 3-saturated (max q used = 13)
    1211             done
     1287        Note the output of the preceding command: it proves that the
     1288        index of the points in their saturation is at most 3, then
     1289        proves saturation at 2 and at 3, by reducing the points modulo
     1290        all primes of good reduction up to 11, respectively 13.
    12121291        """
    12131292        ok, index, unsat = self.__mw.saturate(int(max_prime), odd_primes_only)
    12141293        return bool(ok), int(str(index)), unsat
     
    12501329            sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    12511330            sage: EQ = mwrank_MordellWeil(E)
    12521331            sage: EQ.search(1)
     1332            P1 = [0:1:0]         is torsion point, order 1
     1333            P1 = [-3:0:1]         is generator number 1
     1334            ...
     1335            P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion)
    12531336            sage: EQ
    12541337            Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]]
    12551338
     
    12591342            sage: E = mwrank_EllipticCurve([0, -1, 0, -18392, -1186248]) #1056g4
    12601343            sage: EQ = mwrank_MordellWeil(E)
    12611344            sage: EQ.search(11); EQ
     1345            P1 = [0:1:0]         is torsion point, order 1
     1346            P1 = [161:0:1]       is torsion point, order 2
    12621347            Subgroup of Mordell-Weil group: []
    12631348            sage: EQ.search(12); EQ
     1349            P1 = [0:1:0]         is torsion point, order 1
     1350            P1 = [161:0:1]       is torsion point, order 2
     1351            P1 = [4413270:10381877:27000]         is generator number 1
     1352            ...
    12641353            Subgroup of Mordell-Weil group: [[4413270:10381877:27000]]
    12651354        """
    12661355        height_limit = float(height_limit)
     
    12991388            sage: E = mwrank_EllipticCurve([0,0,1,-7,6])
    13001389            sage: EQ = mwrank_MordellWeil(E)
    13011390            sage: EQ.search(1)
     1391            P1 = [0:1:0]         is torsion point, order 1
     1392            P1 = [-3:0:1]         is generator number 1
     1393            ...
     1394            P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion)
    13021395            sage: EQ.points()
    13031396            [[1, -1, 1], [-2, 3, 1], [-14, 25, 8]]
    13041397
  • sage/libs/mwrank/mwrank.pyx

    diff --git a/sage/libs/mwrank/mwrank.pyx b/sage/libs/mwrank/mwrank.pyx
    a b  
    156156        sage: file = os.path.join(SAGE_TMP, 'PRIMES')
    157157        sage: open(file,'w').write(' '.join([str(p) for p in prime_range(10^7,10^7+20)]))
    158158        sage: mwrank_initprimes(file, verb=True)
    159 
    160     The previous command does produce the following output when run
    161     from the command line, but not during a doctest::
    162 
    163159        Computed 78519 primes, largest is 1000253
    164160        reading primes from file ...
    165161        read extra prime 10000019
     
    567563            sage: EQ.search(1)
    568564            sage: EQ = _mw(E, verb=True)
    569565            sage: EQ.search(1)
     566            P1 = [0:1:0]         is torsion point, order 1
     567            P1 = [-3:0:1]         is generator number 1
     568            ...
     569            P4 = [12:35:27]      = 1*P1 + -1*P2 + -1*P3 (mod torsion)
    570570
    571571        The previous command produces the following output::   
    572572
     
    882882            sage: EQ = _mw(E)       
    883883            sage: EQ.process([494, -5720, 6859]) # 3 times another point
    884884            sage: EQ.saturate(sat_bd=2)
     885            Saturation index bound = 10
     886            WARNING: saturation at primes p > 2 will not be done;
     887            points may be unsaturated at primes between 2 and index bound
     888            Failed to saturate MW basis at primes [ ]
    885889            (0, 1, '[ ]')
    886890            sage: EQ
    887891            [[494:-5720:6859]]
     
    10491053            sage: from sage.libs.mwrank.mwrank import _two_descent
    10501054            sage: D2 = _two_descent()
    10511055            sage: D2.do_descent(CD)
     1056            Basic pair: I=336, J=-10800
     1057            disc=35092224
     1058            ...
     1059            Mordell rank contribution from B=im(eps) = 3
     1060            Selmer  rank contribution from B=im(eps) = 3
     1061            Sha     rank contribution from B=im(eps) = 0
     1062            Mordell rank contribution from A=ker(eps) = 0
     1063            Selmer  rank contribution from A=ker(eps) = 0
     1064            Sha     rank contribution from A=ker(eps) = 0
    10521065            sage: D2.getrank()
    10531066            3
    10541067            sage: D2.getcertain()
     
    10781091            sage: from sage.libs.mwrank.mwrank import _two_descent
    10791092            sage: D2 = _two_descent()
    10801093            sage: D2.do_descent(CD)
     1094            Basic pair: I=336, J=-10800
     1095            disc=35092224
     1096            ...
     1097            Mordell rank contribution from B=im(eps) = 3
     1098            Selmer  rank contribution from B=im(eps) = 3
     1099            Sha     rank contribution from B=im(eps) = 0
     1100            Mordell rank contribution from A=ker(eps) = 0
     1101            Selmer  rank contribution from A=ker(eps) = 0
     1102            Sha     rank contribution from A=ker(eps) = 0
    10811103            sage: D2.getrank()
    10821104            3
    10831105        """
     
    11031125            sage: from sage.libs.mwrank.mwrank import _two_descent
    11041126            sage: D2 = _two_descent()
    11051127            sage: D2.do_descent(CD)
     1128            Basic pair: I=336, J=-10800
     1129            disc=35092224
     1130            ...
     1131            Mordell rank contribution from B=im(eps) = 3
     1132            Selmer  rank contribution from B=im(eps) = 3
     1133            Sha     rank contribution from B=im(eps) = 0
     1134            Mordell rank contribution from A=ker(eps) = 0
     1135            Selmer  rank contribution from A=ker(eps) = 0
     1136            Sha     rank contribution from A=ker(eps) = 0
    11061137            sage: D2.getrankbound()
    11071138            3
    11081139        """
     
    11281159            sage: from sage.libs.mwrank.mwrank import _two_descent
    11291160            sage: D2 = _two_descent()
    11301161            sage: D2.do_descent(CD)
     1162            Basic pair: I=336, J=-10800
     1163            disc=35092224
     1164            ...
     1165            Mordell rank contribution from B=im(eps) = 3
     1166            Selmer  rank contribution from B=im(eps) = 3
     1167            Sha     rank contribution from B=im(eps) = 0
     1168            Mordell rank contribution from A=ker(eps) = 0
     1169            Selmer  rank contribution from A=ker(eps) = 0
     1170            Sha     rank contribution from A=ker(eps) = 0
    11311171            sage: D2.getselmer()
    11321172            3
    11331173        """
     
    11521192            sage: from sage.libs.mwrank.mwrank import _two_descent
    11531193            sage: D2 = _two_descent()
    11541194            sage: D2.do_descent(CD)
     1195            Basic pair: I=336, J=-10800
     1196            disc=35092224
     1197            ...
     1198            Mordell rank contribution from B=im(eps) = 3
     1199            Selmer  rank contribution from B=im(eps) = 3
     1200            Sha     rank contribution from B=im(eps) = 0
     1201            Mordell rank contribution from A=ker(eps) = 0
     1202            Selmer  rank contribution from A=ker(eps) = 0
     1203            Sha     rank contribution from A=ker(eps) = 0
    11551204            sage: D2.ok()
    11561205            1
    11571206        """
     
    11721221            sage: from sage.libs.mwrank.mwrank import _two_descent
    11731222            sage: D2 = _two_descent()
    11741223            sage: D2.do_descent(CD)
     1224            Basic pair: I=336, J=-10800
     1225            disc=35092224
     1226            ...
     1227            Mordell rank contribution from B=im(eps) = 3
     1228            Selmer  rank contribution from B=im(eps) = 3
     1229            Sha     rank contribution from B=im(eps) = 0
     1230            Mordell rank contribution from A=ker(eps) = 0
     1231            Selmer  rank contribution from A=ker(eps) = 0
     1232            Sha     rank contribution from A=ker(eps) = 0
    11751233            sage: D2.getcertain()
    11761234            1
    11771235        """
     
    11921250            sage: from sage.libs.mwrank.mwrank import _two_descent
    11931251            sage: D2 = _two_descent()
    11941252            sage: D2.do_descent(CD)
     1253            Basic pair: I=336, J=-10800
     1254            disc=35092224
     1255            ...
     1256            Mordell rank contribution from B=im(eps) = 3
     1257            Selmer  rank contribution from B=im(eps) = 3
     1258            Sha     rank contribution from B=im(eps) = 0
     1259            Mordell rank contribution from A=ker(eps) = 0
     1260            Selmer  rank contribution from A=ker(eps) = 0
     1261            Sha     rank contribution from A=ker(eps) = 0
    11951262            sage: D2.saturate()
     1263            Searching for points (bound = 8)...done:
     1264              found points which generate a subgroup of rank 3
     1265              and regulator 0.417143558758383969817119544618093396749810106098479
     1266            Processing points found during 2-descent...done:
     1267              now regulator = 0.417143558758383969817119544618093396749810106098479
     1268            No saturation being done
    11961269            sage: D2.getbasis()
    11971270            '[[1:-1:1], [-2:3:1], [-14:25:8]]'
    11981271        """
     
    12241297            sage: from sage.libs.mwrank.mwrank import _two_descent
    12251298            sage: D2 = _two_descent()
    12261299            sage: D2.do_descent(CD)
     1300            Basic pair: I=336, J=-10800
     1301            disc=35092224
     1302            ...
     1303            Mordell rank contribution from B=im(eps) = 3
     1304            Selmer  rank contribution from B=im(eps) = 3
     1305            Sha     rank contribution from B=im(eps) = 0
     1306            Mordell rank contribution from A=ker(eps) = 0
     1307            Selmer  rank contribution from A=ker(eps) = 0
     1308            Sha     rank contribution from A=ker(eps) = 0
    12271309            sage: D2.saturate()
     1310            Searching for points (bound = 8)...done:
     1311              found points which generate a subgroup of rank 3
     1312              and regulator 0.417143558758383969817119544618093396749810106098479
     1313            Processing points found during 2-descent...done:
     1314              now regulator = 0.417143558758383969817119544618093396749810106098479
     1315            No saturation being done
    12281316            sage: D2.getbasis()
    12291317            '[[1:-1:1], [-2:3:1], [-14:25:8]]'
    12301318        """
     
    12461334            sage: from sage.libs.mwrank.mwrank import _two_descent
    12471335            sage: D2 = _two_descent()
    12481336            sage: D2.do_descent(CD)
     1337            Basic pair: I=336, J=-10800
     1338            disc=35092224
     1339            ...
     1340            Mordell rank contribution from B=im(eps) = 3
     1341            Selmer  rank contribution from B=im(eps) = 3
     1342            Sha     rank contribution from B=im(eps) = 0
     1343            Mordell rank contribution from A=ker(eps) = 0
     1344            Selmer  rank contribution from A=ker(eps) = 0
     1345            Sha     rank contribution from A=ker(eps) = 0
    12491346
    12501347        If called before calling ``saturate()``, a bogus value of 1.0
    12511348        is returned::
     
    12581355        2-descent::
    12591356
    12601357            sage: D2.saturate()
     1358            Searching for points (bound = 8)...done:
     1359              found points which generate a subgroup of rank 3
     1360              and regulator 0.417143558758383969817119544618093396749810106098479
     1361            Processing points found during 2-descent...done:
     1362              now regulator = 0.417143558758383969817119544618093396749810106098479
     1363            No saturation being done
    12611364            sage: D2.getbasis()
    12621365            '[[1:-1:1], [-2:3:1], [-14:25:8]]'
    12631366            sage: D2.regulator()
  • sage/libs/singular/function.pyx

    diff --git a/sage/libs/singular/function.pyx b/sage/libs/singular/function.pyx
    a b  
    277277            sage: l = ringlist(P)
    278278            sage: ring = singular_function("ring")
    279279            sage: ring(l, ring=P)._output()
     280            //   characteristic : 0
     281            //   number of vars : 3
     282            //        block   1 : ordering dp
     283            //                  : names    x y z
     284            //        block   2 : ordering C
    280285        """
    281286        rPrint(self._ring)
    282287
     
    12191224            sage: I = Ideal(I.groebner_basis())
    12201225            sage: hilb = sage.libs.singular.ff.hilb
    12211226            sage: hilb(I) # Singular will print // ** _ is no standard basis
     1227            // ** _ is no standard basis
     1228            //         1 t^0
     1229            //        -1 t^5
     1230            <BLANKLINE>
     1231            //         1 t^0
     1232            //         1 t^1
     1233            //         1 t^2
     1234            //         1 t^3
     1235            //         1 t^4
     1236            // dimension (proj.)  = 1
     1237            // degree (proj.)   = 5
    12221238
    12231239        So we tell Singular that ``I`` is indeed a Groebner basis::
    12241240
    12251241            sage: hilb(I,attributes={I:{'isSB':1}}) # no complaint from Singular
     1242            //         1 t^0
     1243            //        -1 t^5
     1244            <BLANKLINE>
     1245            //         1 t^0
     1246            //         1 t^1
     1247            //         1 t^2
     1248            //         1 t^3
     1249            //         1 t^4
     1250            // dimension (proj.)  = 1
     1251            // degree (proj.)   = 5
    12261252
    12271253
    12281254        TESTS:
  • sage/libs/singular/option.pyx

    diff --git a/sage/libs/singular/option.pyx b/sage/libs/singular/option.pyx
    a b  
    398398
    399399    The option ``mult_bound`` is only relevant in the local case::
    400400
     401        sage: from sage.libs.singular.option import opt
    401402        sage: Rlocal.<x,y,z> = PolynomialRing(QQ, order='ds')
    402403        sage: x^2<x
    403404        True
    404405        sage: J = [x^7+y^7+z^6,x^6+y^8+z^7,x^7+y^5+z^8, x^2*y^3+y^2*z^3+x^3*z^2,x^3*y^2+y^3*z^2+x^2*z^3]*Rlocal
    405406        sage: J.groebner_basis(mult_bound=100)
    406407        [x^3*y^2 + y^3*z^2 + x^2*z^3, x^2*y^3 + x^3*z^2 + y^2*z^3, y^5, x^6 + x*y^4*z^5, x^4*z^2 - y^4*z^2 - x^2*y*z^3 + x*y^2*z^3, z^6 - x*y^4*z^4 - x^3*y*z^5]
     408        sage: opt['red_tail'] = True # the previous commands reset opt['red_tail'] to False
    407409        sage: J.groebner_basis()
    408410        [x^3*y^2 + y^3*z^2 + x^2*z^3, x^2*y^3 + x^3*z^2 + y^2*z^3, y^5, x^6, x^4*z^2 - y^4*z^2 - x^2*y*z^3 + x*y^2*z^3, z^6, y^4*z^3 - y^3*z^4 - x^2*z^5, x^3*y*z^4 - x^2*y^2*z^4 + x*y^3*z^4, x^3*z^5, x^2*y*z^5 + y^3*z^5, x*y^3*z^5]
    409411
     
    417419            sage: from sage.libs.singular.option import LibSingularOptions
    418420            sage: libsingular_options = LibSingularOptions()
    419421            sage: libsingular_options
    420             general options for libSingular (current value 0x06000082)
     422            general options for libSingular (current value 0x...)
    421423        """
    422424        self.global_options = &singular_options
    423425        self.name = "general"
  • sage/matrix/benchmark.py

    diff --git a/sage/matrix/benchmark.py b/sage/matrix/benchmark.py
    a b  
    88The basic command syntax is as follows::
    99
    1010    sage: import sage.matrix.benchmark as b
    11     sage: b.report([b.det_ZZ], 'Test', systems=['sage'])
     11    sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], 'Test', systems=['sage'])
     12    starting...
    1213    ======================================================================
    1314              Test
    1415    ======================================================================
     
    3738    EXAMPLES::
    3839
    3940        sage: import sage.matrix.benchmark as b
    40         sage: b.report([b.det_ZZ], 'Test', systems=['sage'])
     41        sage: print "starting"; import sys; sys.stdout.flush(); b.report([b.det_ZZ], 'Test', systems=['sage'])
     42        starting...
    4143        ======================================================================
    4244                  Test
    4345        ======================================================================
     
    9294    EXAMPLES::
    9395
    9496        sage: import sage.matrix.benchmark as b
    95         sage: b.report_ZZ(systems=['sage'])  # long time (15s on sage.math, 2012)
     97        sage: print "starting"; import sys; sys.stdout.flush(); b.report_ZZ(systems=['sage'])  # long time (15s on sage.math, 2012)
     98        starting...
    9699        ======================================================================
    97100        Dense benchmarks over ZZ
    98101        ======================================================================
     
    566569    EXAMPLES::
    567570
    568571        sage: import sage.matrix.benchmark as b
    569         sage: b.report_GF(systems=['sage'])
     572        sage: print "starting"; import sys; sys.stdout.flush(); b.report_GF(systems=['sage'])
     573        starting...
    570574        ======================================================================
    571575        Dense benchmarks over GF with prime 16411
    572576        ======================================================================
  • sage/misc/constant_function.pyx

    diff --git a/sage/misc/constant_function.pyx b/sage/misc/constant_function.pyx
    a b  
    1010
    1111from sage.structure.sage_object cimport SageObject
    1212cdef class ConstantFunction(SageObject):
    13     cdef object _value
    1413    """
    1514    A class for function objects implementing constant functions.
    1615
     
    6059        sage: { 1: 'a', True: 'b' }
    6160        {1: 'b'}
    6261    """
     62    cdef object _value
     63
    6364    def __init__(self, value):
    6465        """
    6566        EXAMPLES::
  • sage/misc/cython.py

    diff --git a/sage/misc/cython.py b/sage/misc/cython.py
    a b  
    693693        sage: f.write(s)
    694694        sage: f.close()
    695695        sage: cython_create_local_so('hello.spyx')
     696        Compiling hello.spyx...
    696697        sage: sys.path.append('.')
    697698        sage: import hello
    698699        sage: hello.hello()
  • sage/misc/hg.py

    diff --git a/sage/misc/hg.py b/sage/misc/hg.py
    a b  
    7070#                  http://www.gnu.org/licenses/
    7171########################################################################
    7272
    73 import os, shutil
     73import os, shutil, sys
    7474
    7575from   viewer import browser
    7676from   misc   import tmp_filename, branch_current_hg, embedded
     
    395395        s = 'cd "%s" && sage --hg %s'%(self.__dir, cmd)
    396396        if debug:
    397397            print s
     398        sys.stdout.flush()
    398399        if interactive:
    399400            e = os.system(s)
    400401            return e
     
    16241625        EXAMPLES::
    16251626
    16261627            sage: hg_sage.qseries()
    1627             cd ... && sage --hg qseries
     1628            cd ... && sage --hg qseries...
    16281629        """
    16291630        options = "--summary" if verbose else ""
    16301631        self('qseries %s %s' % (options, color(),), debug=debug)
     
    16431644        EXAMPLES::
    16441645
    16451646            sage: hg_sage.qapplied()
    1646             cd ... && sage --hg qapplied
     1647            cd ... && sage --hg qapplied...
    16471648        """
    16481649        options = "--summary" if verbose else ""
    16491650        self('qapplied %s %s' % (options, color(),), debug=debug)
     
    16621663        EXAMPLES::
    16631664
    16641665            sage: hg_sage.qunapplied()
    1665             cd ... && sage --hg qunapplied
     1666            cd ... && sage --hg qunapplied...
    16661667        """
    16671668        options = "--summary" if verbose else ""
    16681669        self('qunapplied %s %s' % (options, color(),), debug=debug)
  • sage/misc/interpreter.py

    diff --git a/sage/misc/interpreter.py b/sage/misc/interpreter.py
    a b  
    185185            sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0
    186186            True
    187187            sage: shell.system_raw('R --version')
     188            R version ...
    188189            sage: status = shell.user_ns['_exit_code']
    189190            sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0
    190191            True
  • sage/misc/preparser.py

    diff --git a/sage/misc/preparser.py b/sage/misc/preparser.py
    a b  
    16711671
    16721672    EXAMPLES:
    16731673
    1674     Note that .py files are *not* preparsed::
    1675    
    1676         sage: t=tmp_filename(ext='.py'); open(t,'w').write("print 'hi',2/3; z=-2/9")
    1677         sage: sage.misc.preparser.load(t,globals())
     1674    Note that ``.py`` files are *not* preparsed::
     1675
     1676        sage: t = tmp_filename(ext='.py')
     1677        sage: open(t,'w').write("print 'hi', 2/3; z = -2/7")
     1678        sage: z = 1
     1679        sage: sage.misc.preparser.load(t, globals())
    16781680        hi 0
    16791681        sage: z
    16801682        -1
    16811683
    1682     A .sage file *is* preparsed::
    1683    
    1684         sage: t=tmp_filename(ext='.sage'); open(t,'w').write("print 'hi',2/3; s=-2/7")
    1685         sage: sage.misc.preparser.load(t,globals())
     1684    A ``.sage`` file *is* preparsed::
     1685
     1686        sage: t = tmp_filename(ext='.sage')
     1687        sage: open(t,'w').write("print 'hi', 2/3; z = -2/7")
     1688        sage: z = 1
     1689        sage: sage.misc.preparser.load(t, globals())
    16861690        hi 2/3
    1687         sage: s
     1691        sage: z
    16881692        -2/7
    16891693
    16901694    Cython files are *not* preparsed::
    1691    
    1692         sage: t=tmp_filename(ext='.pyx'); open(t,'w').write("print 'hi',2/3; z=-2/9")
    1693         sage: z=0; sage.misc.preparser.load(t,globals())
     1695
     1696        sage: t = tmp_filename(ext='.pyx')
     1697        sage: open(t,'w').write("print 'hi', 2/3; z = -2/7")
     1698        sage: z = 1
     1699        sage: sage.misc.preparser.load(t, globals())
     1700        Compiling ...
    16941701        hi 0
    16951702        sage: z
    16961703        -1
  • sage/misc/session.pyx

    diff --git a/sage/misc/session.pyx b/sage/misc/session.pyx
    a b  
    244244        - creates a file
    245245
    246246    EXAMPLES:
     247
    247248    For testing, we use a temporary file, that will be removed as soon
    248249    as Sage is left. Of course, for permanently saving your session,
    249     you should choose a permanent file.::
     250    you should choose a permanent file. ::
    250251   
    251252        sage: a = 5
    252253        sage: tmp_f = tmp_filename()
     
    257258        5
    258259
    259260    We illustrate what happens when one of the variables is a function.::
     261
    260262        sage: f = lambda x : x^2
    261263        sage: save_session(tmp_f)
    262264        sage: save_session(tmp_f, verbose=True)
     
    268270   
    269271        sage: g = cython_lambda('double x', 'x*x + 1.5')
    270272        sage: save_session(tmp_f, verbose=True)
    271         Saving...
    272273        Not saving g: g is a function, method, class or type
    273274        ...
    274275    """
  • sage/misc/sh.py

    diff --git a/sage/misc/sh.py b/sage/misc/sh.py
    a b  
    1717        the following really only tests that the command doesn't bomb,
    1818        not that it gives the right output::
    1919
    20             sage: sh.eval('''echo "Hello there"\nif [ $? -eq 0 ]; then\necho "good"\nfi''')
    21             /...
    22             ''
     20            sage: sh.eval('''echo "Hello there"\nif [ $? -eq 0 ]; then\necho "good"\nfi''') # random output
    2321        """
    2422        # Print out the current absolute path, which is where the code
    2523        # will be evaluated.    Evidently, users find this comforting,
  • sage/modular/modform/cuspidal_submodule.py

    diff --git a/sage/modular/modform/cuspidal_submodule.py b/sage/modular/modform/cuspidal_submodule.py
    a b  
    358358        sage: f.qexp(1)
    359359        O(q^1)
    360360    """
     361    pass
    361362
    362363    #def _repr_(self):
    363364    #    A = self.ambient_module()
    364365    #    return "Cuspidal subspace of dimension %s of Modular Forms space with character %s and weight %s over %s"%(self.dimension(), self.character(), self.weight(), self.base_ring())
    365    
    366366
    367367
    368368def _convert_matrix_from_modsyms(symbs, T):
  • sage/modules/vector_double_dense.pyx

    diff --git a/sage/modules/vector_double_dense.pyx b/sage/modules/vector_double_dense.pyx
    a b  
    710710            0.953760808...
    711711            sage: w = vector(CDF, [-1,0,1])
    712712            sage: w.norm(p=-1.6)
     713            Warning: divide by zero encountered in power
    713714            0.0
    714715
    715716        Return values are in ``RDF``, or an integer when ``p = 0``.  ::
  • sage/numerical/backends/glpk_backend.pyx

    diff --git a/sage/numerical/backends/glpk_backend.pyx b/sage/numerical/backends/glpk_backend.pyx
    a b  
    12151215            sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3)
    12161216            sage: p.set_objective([2, 5])
    12171217            sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp"))
     1218            Writing problem data to ...
     1219            9 lines were written
    12181220        """
    12191221        glp_write_lp(self.lp, NULL, filename)
    12201222
     
    12351237            sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3)
    12361238            sage: p.set_objective([2, 5])
    12371239            sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps"), 2)
     1240            Writing problem data to...
     1241            17 records were written
    12381242        """
    12391243        glp_write_mps(self.lp, modern, NULL,  filename)
    12401244
     
    17401744            sage: import sage.numerical.backends.glpk_backend as backend
    17411745            sage: p.solver_parameter(backend.glp_simplex_or_intopt, backend.glp_simplex_only)
    17421746            sage: p.print_ranges()
    1743             ...
     1747            glp_print_ranges: optimal basic solution required
    17441748            1
    17451749            sage: p.solve()
    17461750            0
    17471751            sage: p.print_ranges()
     1752            Write sensitivity analysis report to...
    17481753            GLPK ... - SENSITIVITY ANALYSIS REPORT                                                                         Page   1
    17491754            <BLANKLINE>
    1750             Problem:   
     1755            Problem:
    17511756            Objective:  7.5 (MAXimum)
    17521757            <BLANKLINE>
    17531758               No. Row name     St      Activity         Slack   Lower bound       Activity      Obj coef  Obj value at Limiting
    17541759                                                      Marginal   Upper bound          range         range   break point variable
    17551760            ------ ------------ -- ------------- ------------- -------------  ------------- ------------- ------------- ------------
    1756                  1              NU       3.00000        .               -Inf         .           -2.50000        .     
     1761                 1              NU       3.00000        .               -Inf         .           -2.50000        .
    17571762                                                       2.50000       3.00000           +Inf          +Inf          +Inf
    17581763            <BLANKLINE>
    17591764            GLPK ... - SENSITIVITY ANALYSIS REPORT                                                                         Page   2
    17601765            <BLANKLINE>
    1761             Problem:   
     1766            Problem:
    17621767            Objective:  7.5 (MAXimum)
    17631768            <BLANKLINE>
    17641769               No. Column name  St      Activity      Obj coef   Lower bound       Activity      Obj coef  Obj value at Limiting
     
    17731778            End of report
    17741779            <BLANKLINE>
    17751780            0
    1776 
    1777 
    17781781        """
    17791782
    17801783        from sage.misc.all import SAGE_TMP
  • sage/numerical/mip.pyx

    diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
    a b  
    855855            sage: p.set_objective(x[1] + x[2])
    856856            sage: p.add_constraint(-3*x[1] + 2*x[2], max=2,name="OneConstraint")
    857857            sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps"))
     858            Writing problem data to ...
     859            17 records were written
    858860
    859861        For information about the MPS file format :
    860862        http://en.wikipedia.org/wiki/MPS_%28format%29
     
    880882            sage: p.set_objective(x[1] + x[2])
    881883            sage: p.add_constraint(-3*x[1] + 2*x[2], max=2)
    882884            sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp"))
     885            Writing problem data to ...
     886            9 lines were written
    883887
    884888        For more information about the LP file format :
    885889        http://lpsolve.sourceforge.net/5.5/lp-format.htm
     
    18521856            sage: b = p.get_backend()
    18531857            sage: b.solver_parameter("simplex_or_intopt", "simplex_only")
    18541858            sage: b.solver_parameter("verbosity_simplex", "GLP_MSG_ALL")
    1855             sage: p.solve() # tol 0.00001
     1859            sage: p.solve()  # tol 0.00001
     1860            GLPK Simplex Optimizer, v4.44
     1861            2 rows, 2 columns, 4 non-zeros
     1862            *     0: obj =   7.000000000e+00  infeas =  0.000e+00 (0)
     1863            *     2: obj =   9.400000000e+00  infeas =  0.000e+00 (0)
     1864            OPTIMAL SOLUTION FOUND
    18561865            9.4
    1857 
    18581866        """
    18591867        return self._backend
    18601868
  • sage/numerical/optimize.py

    diff --git a/sage/numerical/optimize.py b/sage/numerical/optimize.py
    a b  
    525525        sage: sol['x']
    526526        (45.000000..., 6.2499999...3, 1.00000000...)
    527527        sage: sol=linear_program(v,m,h,solver='glpk')
     528        GLPK Simplex Optimizer...
     529        OPTIMAL SOLUTION FOUND
    528530        sage: sol['x']
    529531        (45.0..., 6.25, 1.0...)
    530532    """
  • sage/parallel/decorate.py

    diff --git a/sage/parallel/decorate.py b/sage/parallel/decorate.py
    a b  
    556556        sage: cython('def f(): print <char*>0')
    557557        sage: @fork
    558558        ... def g(): f()
    559         sage: g()
     559        sage: print "this works"; g()
     560        this works...
     561        <BLANKLINE>
     562        ------------------------------------------------------------------------
     563        Unhandled SIG...
     564        ------------------------------------------------------------------------
    560565        'NO DATA'
    561566    """
    562567    F = Fork(timeout=timeout, verbose=verbose)
  • sage/plot/line.py

    diff --git a/sage/plot/line.py b/sage/plot/line.py
    a b  
    426426
    427427        sage: E = EllipticCurve('37a')
    428428        sage: vals = E.lseries().values_along_line(1-I, 1+10*I, 100) # critical line
     429          ***   Warning: new stack size = ...
    429430        sage: L = [(z[1].real(), z[1].imag()) for z in vals]
    430431        sage: line(L, rgbcolor=(3/4,1/2,5/8))
    431432 
  • sage/rings/fraction_field_FpT.pyx

    diff --git a/sage/rings/fraction_field_FpT.pyx b/sage/rings/fraction_field_FpT.pyx
    a b  
    988988        return self.cur
    989989
    990990cdef class Polyring_FpT_coerce(RingHomomorphism_coercion):
    991     cdef long p
    992991    """
    993992    This class represents the coercion map from GF(p)[t] to GF(p)(t)
    994993
     
    10031002        sage: type(f)
    10041003        <type 'sage.rings.fraction_field_FpT.Polyring_FpT_coerce'>
    10051004    """
     1005    cdef long p
     1006
    10061007    def __init__(self, R):
    10071008        """
    10081009        INPUTS:
     
    11131114        return FpT_Polyring_section(self)
    11141115
    11151116cdef class FpT_Polyring_section(Section):
    1116     cdef long p
    11171117    """
    11181118    This class represents the section from GF(p)(t) back to GF(p)[t]
    11191119
     
    11281128        sage: type(f)
    11291129        <type 'sage.rings.fraction_field_FpT.FpT_Polyring_section'>
    11301130    """
     1131    cdef long p
     1132
    11311133    def __init__(self, Polyring_FpT_coerce f):
    11321134        """
    11331135        INPUTS:
     
    11801182        return ans
    11811183
    11821184cdef class Fp_FpT_coerce(RingHomomorphism_coercion):
    1183     cdef long p
    11841185    """
    11851186    This class represents the coercion map from GF(p) to GF(p)(t)
    11861187
     
    11951196        sage: type(f)
    11961197        <type 'sage.rings.fraction_field_FpT.Fp_FpT_coerce'>
    11971198    """
     1199    cdef long p
     1200
    11981201    def __init__(self, R):
    11991202        """
    12001203        INPUTS:
     
    13101313        return FpT_Fp_section(self)
    13111314
    13121315cdef class FpT_Fp_section(Section):
    1313     cdef long p
    13141316    """
    13151317    This class represents the section from GF(p)(t) back to GF(p)[t]
    13161318
     
    13251327        sage: type(f)
    13261328        <type 'sage.rings.fraction_field_FpT.FpT_Fp_section'>
    13271329    """
     1330    cdef long p
     1331
    13281332    def __init__(self, Fp_FpT_coerce f):
    13291333        """
    13301334        INPUTS:
     
    13851389        return ans
    13861390
    13871391cdef class ZZ_FpT_coerce(RingHomomorphism_coercion):
    1388     cdef long p
    13891392    """
    13901393    This class represents the coercion map from ZZ to GF(p)(t)
    13911394
     
    14001403        sage: type(f)
    14011404        <type 'sage.rings.fraction_field_FpT.ZZ_FpT_coerce'>
    14021405    """
     1406    cdef long p
     1407
    14031408    def __init__(self, R):
    14041409        """
    14051410        INPUTS:
  • sage/rings/number_field/number_field_ideal.py

    diff --git a/sage/rings/number_field/number_field_ideal.py b/sage/rings/number_field/number_field_ideal.py
    a b  
    814814            sage: P = EllipticCurve(L, '57a1').lift_x(z_x) * 3
    815815            sage: ideal = L.fractional_ideal(P[0], P[1])
    816816            sage: ideal.is_principal(proof=False)
     817              ***   Warning: precision too low for generators, not given.
    817818            True
    818819            sage: len(ideal.gens_reduced(proof=False))
    819820            1
  • sage/rings/number_field/order.py

    diff --git a/sage/rings/number_field/order.py b/sage/rings/number_field/order.py
    a b  
    237237            sage: k.<a> = NumberField(x^2 + 5077); G = k.class_group(); G
    238238            Class group of order 22 with structure C22 of Number Field in a with defining polynomial x^2 + 5077
    239239            sage: G.0
    240             Fractional ideal class (11, a + 7)   # 32-bit
    241             Fractional ideal class (23, a + 12)  # 64-bit
     240            Fractional ideal class (11, a + 7)
    242241            sage: Ok = k.maximal_order(); Ok
    243242            Maximal Order in Number Field in a with defining polynomial x^2 + 5077
    244243            sage: Ok * (11, a + 7)
  • sage/rings/padics/padic_capped_relative_element.pyx

    diff --git a/sage/rings/padics/padic_capped_relative_element.pyx b/sage/rings/padics/padic_capped_relative_element.pyx
    a b  
    23692369            sage: hash(R(17)) #indirect doctest
    23702370            17
    23712371           
    2372             sage: hash(R(-1)) # 32-bit
    2373             1977822444
    2374            
    2375             sage: hash(R(-1)) # 64-bit
    2376             95367431640624
     2372            sage: hash(R(-1))
     2373            1977822444 # 32-bit
     2374            95367431640624 # 64-bit
    23772375        """
    23782376        return hash(self.lift_c())
    23792377
  • sage/rings/polynomial/multi_polynomial_ideal.py

    diff --git a/sage/rings/polynomial/multi_polynomial_ideal.py b/sage/rings/polynomial/multi_polynomial_ideal.py
    a b  
    36953695            product criterion:1 chain criterion:0
    36963696            [x^3 + y^2, x^2*y + 1, y^3 - x]
    36973697            sage: I.groebner_basis(prot=False)
     3698            std in (0),(x,y),(dp(2),C)
     3699            [4294967295:2]3ss4s6
     3700            (S:2)--
     3701            product criterion:1 chain criterion:0
    36983702            [x^3 + y^2, x^2*y + 1, y^3 - x]
    36993703            sage: set_verbose(0)
    37003704            sage: I.groebner_basis(prot=True)  # not tested
  • sage/rings/polynomial/polynomial_element.pyx

    diff --git a/sage/rings/polynomial/polynomial_element.pyx b/sage/rings/polynomial/polynomial_element.pyx
    a b  
    27702770
    27712771            sage: pari.default("debug", 3)
    27722772            sage: F = pol.factor()
    2773 
     2773            <BLANKLINE>
    27742774            Entering nffactor:
    27752775            ...
    27762776            sage: pari.default("debug", 0)
     
    47334733             (... + 1.25992104989*I, 1),
    47344734             (1.09112363597 - 0.629960524947*I, 1)]
    47354735            sage: f.roots(multiplicities=False)
    4736             [-1.09112363597 - 0.629960524947*I,
    4737              ... + 1.25992104989r*I,
    4738              1.09112363597 - 0.629960524947*I]
     4736            [-1.09112363597 - 0.629960524947*I, ... + 1.25992104989*I, 1.09112363597 - 0.629960524947*I]
    47394737            sage: [f(z) for z in f.roots(multiplicities=False)] # random, too close to 0
    47404738            [-2.56337823492e-15 - 6.66133814775e-15*I,
    47414739             3.96533069372e-16 + 1.99840144433e-15*I,
  • sage/rings/polynomial/polynomial_integer_dense_ntl.pyx

    diff --git a/sage/rings/polynomial/polynomial_integer_dense_ntl.pyx b/sage/rings/polynomial/polynomial_integer_dense_ntl.pyx
    a b  
    154154
    155155            sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^3: 1})
    156156            x^8
    157             sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^30: 1}) # 32-bit
    158             sage: PolynomialRing(ZZ, 'x', implementation='NTL')({2^62: 1}) # 64-bit
     157            sage: import sys
     158            sage: PolynomialRing(ZZ, 'x', implementation='NTL')({sys.maxint>>1: 1})
    159159            Traceback (most recent call last):
    160160            ...
    161161            OverflowError: Dense NTL integer polynomials have a maximum degree of 268435455    # 32-bit
  • sage/rings/polynomial/symmetric_ideal.py

    diff --git a/sage/rings/polynomial/symmetric_ideal.py b/sage/rings/polynomial/symmetric_ideal.py
    a b  
    462462            sage: I.interreduction(report=True)
    463463            Symmetric interreduction
    464464            [1/2]  >
    465             [2/2] : >
     465            [2/2] :>
    466466            [1/2]  >
    467             [2/2] T[1] >
     467            [2/2] T[1]>
    468468            >
    469469            Symmetric Ideal (-x_1^2, x_2 + x_1) of Infinite polynomial ring in x over Rational Field
    470470
     
    824824            sage: I1.groebner_basis(report=True, reduced=True)
    825825            Symmetric interreduction
    826826            [1/2]  >
    827             [2/2] : >
     827            [2/2] :>
    828828            [1/2]  >
    829829            [2/2]  >
    830830            Symmetrise 2 polynomials at level 2
     
    834834            Symmetric interreduction
    835835            [1/3]  >
    836836            [2/3]  >
    837             [3/3] : >
     837            [3/3] :>
    838838            -> 0
    839839            [1/2]  >
    840840            [2/2]  >
     
    854854            ::>
    855855            Symmetric interreduction
    856856            [1/4]  >
    857             [2/4] : >
     857            [2/4] :>
    858858            -> 0
    859             [3/4] :: >
     859            [3/4] ::>
    860860            -> 0
    861             [4/4] : >
     861            [4/4] :>
    862862            -> 0
    863863            [1/1]  >
    864864            Apply permutations
     
    881881            :>
    882882            Symmetric interreduction
    883883            [1/2]  >
    884             [2/2] : >
     884            [2/2] :>
    885885            -> 0
    886886            [1/1]  >
    887887            Symmetric interreduction
  • sage/schemes/elliptic_curves/ell_rational_field.py

    diff --git a/sage/schemes/elliptic_curves/ell_rational_field.py b/sage/schemes/elliptic_curves/ell_rational_field.py
    a b  
    13051305            sage: E.analytic_rank(algorithm='pari')
    13061306            2
    13071307            sage: E.analytic_rank(algorithm='rubinstein')
     1308              ***   Warning: new stack size = ...
    13081309            2
    13091310            sage: E.analytic_rank(algorithm='sympow')
    13101311            2
    13111312            sage: E.analytic_rank(algorithm='magma')    # optional - magma
    13121313            2
    13131314            sage: E.analytic_rank(algorithm='all')
     1315              ***   Warning: new stack size = ...
    13141316            2
    13151317
    13161318        With the optional parameter leading_coefficient set to ``True``, a
     
    21282130            sage: E.saturation([P])
    21292131            ([(-192128125858676194585718821667542660822323528626273/336995568430319276695106602174283479617040716649 : 70208213492933395764907328787228427430477177498927549075405076353624188436/195630373799784831667835900062564586429333568841391304129067339731164107 : 1)], 1, 113.302910926080)
    21302132            sage: E.saturation([2*P]) ## needs higher precision
     2133            After 10 attempts at enlargement, giving up!
    21312134            ...
    21322135            ([(1755450733726721618440965414535034458701302721700399/970334851896750960577261378321772998240802013604 : -59636173615502879504846810677646864329901430096139563516090202443694810309127/955833935771565601591243078845907133814963790187832340692216425242529192 : 1)], 2, 113.302910926080)
    21332136
  • sage/schemes/elliptic_curves/lseries_ell.py

    diff --git a/sage/schemes/elliptic_curves/lseries_ell.py b/sage/schemes/elliptic_curves/lseries_ell.py
    a b  
    224224        EXAMPLES:
    225225            sage: E = EllipticCurve('37a')
    226226            sage: E.lseries().zeros(2)
     227              ***   Warning: new stack size = ...
    227228            [0.000000000, 5.00317001]
    228229
    229230            sage: a = E.lseries().zeros(20)             # long time
     231              ***   Warning: new stack size = ...
    230232            sage: point([(1,x) for x in a])             # graph  (long time)
    231233
    232234        AUTHOR:
     
    256258        EXAMPLES:
    257259            sage: E = EllipticCurve('37a')
    258260            sage: E.lseries().zeros_in_interval(6, 10, 0.1)      # long time
     261              ***   Warning: new stack size = ...
    259262            [(6.87039122, 0.248922780), (8.01433081, -0.140168533), (9.93309835, -0.129943029)]
    260263        """
    261264        from sage.lfunctions.lcalc import lcalc
     
    341344        EXAMPLES:
    342345            sage: E = EllipticCurve('37a')
    343346            sage: E.lseries().twist_zeros(3, -4, -3)         # long time
     347              ***   Warning: new stack size = ...
    344348            {-4: [1.60813783, 2.96144840, 3.89751747], -3: [2.06170900, 3.48216881, 4.45853219]}
    345349        """
    346350        from sage.lfunctions.lcalc import lcalc
  • sage/schemes/generic/morphism.py

    diff --git a/sage/schemes/generic/morphism.py b/sage/schemes/generic/morphism.py
    a b  
    13371337#*******************************************************************
    13381338# Abelian varieties
    13391339#*******************************************************************
    1340 class SchemeMorphism_point_abelian_variety_field\
    1341         (AdditiveGroupElement, SchemeMorphism_point_projective_field):
     1340class SchemeMorphism_point_abelian_variety_field(
     1341       AdditiveGroupElement, SchemeMorphism_point_projective_field):
    13421342    """
    13431343    A rational point of an abelian variety over a field.
    13441344
  • sage/schemes/toric/variety.py

    diff --git a/sage/schemes/toric/variety.py b/sage/schemes/toric/variety.py
    a b  
    1 r"""
     1# -*- coding: utf-8 -*-
     2r"""
    23Toric varieties
    34
    45This module provides support for (normal) toric varieties, corresponding to
  • sage/structure/parent_old.pyx

    diff --git a/sage/structure/parent_old.pyx b/sage/structure/parent_old.pyx
    a b  
    5757    """
    5858    Parents are the SAGE/mathematical analogues of container objects
    5959    in computer science.
     60
     61    TESTS::
     62
     63        sage: V = VectorSpace(GF(2,'a'),2)
     64        sage: V.list()
     65        [(0, 0), (1, 0), (0, 1), (1, 1)]
     66        sage: MatrixSpace(GF(3), 1, 1).list()
     67        [[0], [1], [2]]
     68        sage: DirichletGroup(3).list()
     69        [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1,
     70        Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1]
     71        sage: K = GF(7^6,'a')
     72        sage: K.list()[:10] # long time
     73        [0, 1, 2, 3, 4, 5, 6, a, a + 1, a + 2]
     74        sage: K.<a> = GF(4)
     75        sage: K.list()
     76        [0, a, a + 1, 1]
    6077    """
    6178   
    6279    def __init__(self, coerce_from=[], actions=[], embeddings=[], category=None):
     
    400417    # This is just a convenient spot to cover the relevant cython parents,
    401418    # without bothering the new parents
    402419    list = parent.Parent._list_from_iterator_cached
    403     """
    404     TESTS::
    405 
    406         sage: V = VectorSpace(GF(2,'a'),2)
    407         sage: V.list()
    408         [(0, 0), (1, 0), (0, 1), (1, 1)]
    409         sage: MatrixSpace(GF(3), 1, 1).list()
    410         [[0], [1], [2]]
    411         sage: DirichletGroup(3).list()
    412         [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1,
    413         Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1]
    414         sage: K = GF(7^6,'a')
    415         sage: K.list()[:10] # long time
    416         [0, 1, 2, 3, 4, 5, 6, a, a + 1, a + 2]
    417         sage: K.<a> = GF(4)
    418         sage: K.list()
    419         [0, a, a + 1, 1]
    420     """
    421 
    422420
    423421       
    424422    ################################################
  • sage/symbolic/expression.pyx

    diff --git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
    a b  
    35253525
    35263526        EXAMPLES::
    35273527       
    3528             sage: var('x,y,z,a,b,c,d,e,f')
    3529             (x, y, z, a, b, c, d, e, f)
     3528            sage: var('x,y,z,a,b,c,d,f,g')
     3529            (x, y, z, a, b, c, d, f, g)
    35303530            sage: w0 = SR.wild(0); w1 = SR.wild(1); w2 = SR.wild(2)
    35313531            sage: ((x+y)^a).match((x+y)^a)  # no wildcards, so empty dict
    35323532            {}
     
    35493549            sage: t = (a*(x+y)+a*z+b).match(a*w0+w1)
    35503550            sage: t[w0], t[w1]
    35513551            (x + y, a*z + b)
    3552             sage: print (a+b+c+d+e+f).match(c)
     3552            sage: print (a+b+c+d+f+g).match(c)
    35533553            None
    3554             sage: (a+b+c+d+e+f).has(c)
     3554            sage: (a+b+c+d+f+g).has(c)
    35553555            True
    3556             sage: (a+b+c+d+e+f).match(c+w0)
    3557             {$0: a + b + d + e + f}
    3558             sage: (a+b+c+d+e+f).match(c+e+w0)
     3556            sage: (a+b+c+d+f+g).match(c+w0)
     3557            {$0: a + b + d + f + g}
     3558            sage: (a+b+c+d+f+g).match(c+g+w0)
    35593559            {$0: a + b + d + f}
    35603560            sage: (a+b).match(a+b+w0)
    35613561            {$0: 0}
     
    36913691        """
    36923692        EXAMPLES::
    36933693       
    3694             sage: var('x,y,z,a,b,c,d,e,f')
    3695             (x, y, z, a, b, c, d, e, f)
     3694            sage: var('x,y,z,a,b,c,d,f,g')
     3695            (x, y, z, a, b, c, d, f, g)
    36963696            sage: w0 = SR.wild(0); w1 = SR.wild(1)
    36973697            sage: t = a^2 + b^2 + (x+y)^3
    36983698           
     
    38143814        """
    38153815        EXAMPLES::
    38163816       
    3817             sage: var('x,y,z,a,b,c,d,e,f')
    3818             (x, y, z, a, b, c, d, e, f)
     3817            sage: var('x,y,z,a,b,c,d,f')
     3818            (x, y, z, a, b, c, d, f)
    38193819            sage: w0 = SR.wild(0); w1 = SR.wild(1)
    38203820            sage: (a^2 + b^2 + (x+y)^2)._subs_expr(w0^2 == w0^3)
    38213821            (x + y)^3 + a^3 + b^3
     
    67256725
    67266726        ::
    67276727
    6728             sage: gp('gamma(1+I)') # 32-bit
    6729             0.4980156681183560427136911175 - 0.1549498283018106851249551305*I
    6730 
    6731         ::
    6732 
    6733             sage: gp('gamma(1+I)') # 64-bit
    6734             0.49801566811835604271369111746219809195 - 0.15494982830181068512495513048388660520*I
     6728            sage: gp('gamma(1+I)')
     6729            0.4980156681183560427136911175 - 0.1549498283018106851249551305*I # 32-bit
     6730            0.49801566811835604271369111746219809195 - 0.15494982830181068512495513048388660520*I # 64-bit
    67356731
    67366732        We plot the familiar plot of this log-convex function::
    67376733
     
    84478443        assumed to be an integer, a real if with ``r``, and so on::
    84488444
    84498445            sage: solve( sin(x)==cos(x), x, to_poly_solve=True)
    8450             [x == 1/4*pi + pi*z74]
     8446            [x == 1/4*pi + pi*z...]
    84518447       
    84528448        An effort is made to only return solutions that satisfy the current assumptions::
    84538449       
     
    84878483            sage: from sage.calculus.calculus import maxima
    84888484            sage: sol = maxima(cos(x)==0).to_poly_solve(x)
    84898485            sage: sol.sage()
    8490             [[x == -1/2*pi + 2*pi*z86], [x == 1/2*pi + 2*pi*z88]]
     8486            [[x == -1/2*pi + 2*pi*z...], [x == 1/2*pi + 2*pi*z...]]
    84918487
    84928488        If a returned unsolved expression has a denominator, but the
    84938489        original one did not, this may also be true::
     
    84978493            sage: from sage.calculus.calculus import maxima
    84988494            sage: sol = maxima(cos(x) * sin(x) == 1/2).to_poly_solve(x)
    84998495            sage: sol.sage()
    8500             [[x == 1/4*pi + pi*z102]]
     8496            [[x == 1/4*pi + pi*z...]]
    85018497
    85028498        Some basic inequalities can be also solved::
    85038499
     
    85548550        ::
    85558551
    85568552            sage: solve(sin(x)==1/2,x,to_poly_solve='force')
    8557             [x == 5/6*pi + 2*pi*z116, x == 1/6*pi + 2*pi*z114]
     8553            [x == 5/6*pi + 2*pi*z..., x == 1/6*pi + 2*pi*z...]
    85588554
    85598555        :trac:`11618` fixed::
    85608556
     
    87928788            sage: b.solve(t)
    87938789            []
    87948790            sage: b.solve(t, to_poly_solve=True)
    8795             [t == 1/450*I*pi*z128 + 1/900*log(3/4*sqrt(41) + 25/4), t == 1/450*I*pi*z126 + 1/900*log(-3/4*sqrt(41) + 25/4)]
     8791            [t == 1/450*I*pi*z... + 1/900*log(3/4*sqrt(41) + 25/4), t == 1/450*I*pi*z... + 1/900*log(-3/4*sqrt(41) + 25/4)]
    87968792            sage: n(1/900*log(-3/4*sqrt(41) + 25/4))
    87978793            0.000411051404934985
    87988794
  • sage/symbolic/function.pyx

    diff --git a/sage/symbolic/function.pyx b/sage/symbolic/function.pyx
    a b  
    622622            sage: import numpy
    623623            sage: a = numpy.arange(5)
    624624            sage: csc(a)
     625            Warning: divide by zero encountered in divide
    625626            array([        inf,  1.18839511,  1.09975017,  7.0861674 , -1.32134871])
    626627
    627628            sage: factorial(a)
  • sage/tests/cmdline.py

    diff --git a/sage/tests/cmdline.py b/sage/tests/cmdline.py
    a b  
    332332        sage: (out, err, ret) = test_executable(["sage", "-t", script])
    333333        sage: ret
    334334        128
    335         sage: out.find("1 items had failures:") >= 0
     335        sage: out.find("1 item had failures:") >= 0
    336336        True
    337337        sage: os.environ['SAGE_TESTDIR'] = OLD_TESTDIR  # just in case
    338338