Skip to content

Commit ef7a598

Browse files
author
Release Manager
committed
gh-37609: src/sage/schemes: Doctest cosmetics <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Standard reformatting of doctests and their outputs Split out from #35095 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #37609 Reported by: Matthias Köppe Reviewer(s): Giacomo Pope, Matthias Köppe
2 parents edeb26c + 86143e8 commit ef7a598

16 files changed

+213
-188
lines changed

src/sage/schemes/elliptic_curves/Qcurves.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ def is_Q_curve(E, maxp=100, certificate=False, verbose=False):
195195
True
196196
sage: cert
197197
{'CM': 0,
198-
'N': 2,
199-
'core_degs': [1, 2],
200-
'core_poly': x^2 - 840064*x + 1593413632,
201-
'r': 1,
202-
'rho': 1}
198+
'N': 2,
199+
'core_degs': [1, 2],
200+
'core_poly': x^2 - 840064*x + 1593413632,
201+
'r': 1,
202+
'rho': 1}
203203
204204
TESTS::
205205

src/sage/schemes/elliptic_curves/ell_curve_isogeny.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,8 @@ def _call_(self, P):
12291229
Traceback (most recent call last):
12301230
...
12311231
TypeError: (20 : 90 : 1) fails to convert into the map's domain
1232-
Elliptic Curve defined by y^2 = x^3 + 7*x over Number Field in th with defining polynomial x^2 + 3,
1232+
Elliptic Curve defined by y^2 = x^3 + 7*x over
1233+
Number Field in th with defining polynomial x^2 + 3,
12331234
but a `pushforward` method is not properly implemented
12341235
12351236
Check that copying the order over works::

src/sage/schemes/elliptic_curves/ell_generic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,11 @@ def __call__(self, *args, **kwds):
546546
sage: T = E.torsion_subgroup()
547547
sage: [E(t) for t in T]
548548
[(0 : 1 : 0),
549-
(9 : 23 : 1),
550-
(2 : 2 : 1),
551-
(1 : -1 : 1),
552-
(2 : -5 : 1),
553-
(9 : -33 : 1)]
549+
(9 : 23 : 1),
550+
(2 : 2 : 1),
551+
(1 : -1 : 1),
552+
(2 : -5 : 1),
553+
(9 : -33 : 1)]
554554
555555
::
556556

src/sage/schemes/elliptic_curves/ell_local_data.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def _tate(self, proof=None, globally=False):
742742
sage: # needs sage.rings.number_field
743743
sage: K.<t> = NumberField(x^7 - 2*x + 177)
744744
sage: E = EllipticCurve([0,1,0,t,t])
745-
sage: P = K.ideal(2,t^3 + t + 1)
745+
sage: P = K.ideal(2, t^3 + t + 1)
746746
sage: E.local_data(P).kodaira_symbol()
747747
II
748748
"""
@@ -1142,29 +1142,29 @@ def check_prime(K, P):
11421142
11431143
.. NOTE::
11441144
1145-
If `P` is not a prime and does not generate a prime, a ``TypeError``
1145+
If `P` is not a prime and does not generate a prime, a :class:`TypeError`
11461146
is raised.
11471147
11481148
EXAMPLES::
11491149
11501150
sage: from sage.schemes.elliptic_curves.ell_local_data import check_prime
1151-
sage: check_prime(QQ,3)
1151+
sage: check_prime(QQ, 3)
11521152
3
1153-
sage: check_prime(QQ,QQ(3))
1153+
sage: check_prime(QQ, QQ(3))
11541154
3
1155-
sage: check_prime(QQ,ZZ.ideal(31))
1155+
sage: check_prime(QQ, ZZ.ideal(31))
11561156
31
11571157
11581158
sage: # needs sage.rings.number_field
11591159
sage: x = polygen(ZZ, 'x')
11601160
sage: K.<a> = NumberField(x^2 - 5)
11611161
sage: check_prime(K, a)
11621162
Fractional ideal (a)
1163-
sage: check_prime(K,a+1)
1163+
sage: check_prime(K, a + 1)
11641164
Fractional ideal (a + 1)
1165-
sage: [check_prime(K,P) for P in K.primes_above(31)]
1165+
sage: [check_prime(K, P) for P in K.primes_above(31)]
11661166
[Fractional ideal (5/2*a + 1/2), Fractional ideal (5/2*a - 1/2)]
1167-
sage: L.<b> = NumberField(x^2+3)
1167+
sage: L.<b> = NumberField(x^2 + 3)
11681168
sage: check_prime(K, L.ideal(5))
11691169
Traceback (most recent call last):
11701170
...

src/sage/schemes/elliptic_curves/ell_point.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3265,23 +3265,23 @@ def archimedean_local_height(self, v=None, prec=None, weighted=False):
32653265
def non_archimedean_local_height(self, v=None, prec=None,
32663266
weighted=False, is_minimal=None):
32673267
"""
3268-
Compute the local height of self at the non-archimedean place `v`.
3268+
Compute the local height of ``self`` at the non-archimedean place `v`.
32693269
32703270
INPUT:
32713271
32723272
- ``self`` -- a point on an elliptic curve over a number field
32733273
`K`.
32743274
3275-
- ``v`` -- a non-archimedean place of `K`, or None (default).
3275+
- ``v`` -- a non-archimedean place of `K`, or ``None`` (default).
32763276
If `v` is a non-archimedean place, return the local height
3277-
of self at `v`. If `v` is None, return the total
3277+
of self at `v`. If `v` is ``None``, return the total
32783278
non-archimedean contribution to the global height.
32793279
3280-
- ``prec`` -- integer, or None (default). The precision of the
3281-
computation. If None, the height is returned symbolically.
3280+
- ``prec`` -- integer, or ``None`` (default). The precision of the
3281+
computation. If ``None``, the height is returned symbolically.
32823282
3283-
- ``weighted`` -- boolean. If False (default), the height is
3284-
normalised to be invariant under extension of `K`. If True,
3283+
- ``weighted`` -- boolean. If ``False`` (default), the height is
3284+
normalised to be invariant under extension of `K`. If ``True``,
32853285
return this normalised height multiplied by the local degree
32863286
if `v` is a single place, or by the degree of `K` if `v` is
32873287
None.

src/sage/schemes/elliptic_curves/gal_reps_number_field.py

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class GaloisRepresentation(SageObject):
8080
sage: E = EllipticCurve('11a1').change_ring(K)
8181
sage: rho = E.galois_representation()
8282
sage: rho
83-
Compatible family of Galois representations associated to the Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20) over Number Field in a with defining polynomial x^2 + 1
83+
Compatible family of Galois representations associated to the Elliptic Curve
84+
defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20)
85+
over Number Field in a with defining polynomial x^2 + 1
8486
"""
8587

8688
def __init__(self, E):
@@ -94,7 +96,9 @@ def __init__(self, E):
9496
sage: E = EllipticCurve('11a1').change_ring(K)
9597
sage: rho = E.galois_representation()
9698
sage: rho
97-
Compatible family of Galois representations associated to the Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20) over Number Field in a with defining polynomial x^2 + 1
99+
Compatible family of Galois representations associated to the Elliptic Curve
100+
defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20)
101+
over Number Field in a with defining polynomial x^2 + 1
98102
sage: loads(rho.dumps()) == rho
99103
True
100104
"""
@@ -111,12 +115,16 @@ def __repr__(self):
111115
sage: E = EllipticCurve('11a1').change_ring(K)
112116
sage: rho = E.galois_representation()
113117
sage: rho
114-
Compatible family of Galois representations associated to the Elliptic Curve defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20) over Number Field in a with defining polynomial x^2 + 1
118+
Compatible family of Galois representations associated to the Elliptic Curve
119+
defined by y^2 + y = x^3 + (-1)*x^2 + (-10)*x + (-20)
120+
over Number Field in a with defining polynomial x^2 + 1
115121
116122
sage: K.<a> = NumberField(x^2-x+1)
117123
sage: E = EllipticCurve([0,0,0,a,0])
118124
sage: E.galois_representation()
119-
Compatible family of Galois representations associated to the CM Elliptic Curve defined by y^2 = x^3 + a*x over Number Field in a with defining polynomial x^2 - x + 1
125+
Compatible family of Galois representations associated to the
126+
CM Elliptic Curve defined by y^2 = x^3 + a*x
127+
over Number Field in a with defining polynomial x^2 - x + 1
120128
"""
121129
if self.E.has_cm():
122130
return "Compatible family of Galois representations associated to the CM " + repr(self.E)
@@ -225,10 +233,10 @@ def is_surjective(self, p, A=100):
225233
226234
INPUT:
227235
228-
* ``p`` - int - a prime number.
236+
* ``p`` -- a prime number.
229237
230-
* ``A`` - int - a bound on the number of traces of Frobenius to use
231-
while trying to prove surjectivity.
238+
* ``A`` -- (integer) a bound on the number of traces of Frobenius to use
239+
while trying to prove surjectivity.
232240
233241
EXAMPLES::
234242
@@ -258,7 +266,7 @@ def is_surjective(self, p, A=100):
258266
259267
For CM curves, the mod-p representation is never surjective::
260268
261-
sage: K.<a> = NumberField(x^2-x+1)
269+
sage: K.<a> = NumberField(x^2 - x + 1)
262270
sage: E = EllipticCurve([0,0,0,0,a])
263271
sage: E.has_cm()
264272
True
@@ -320,7 +328,7 @@ def isogeny_bound(self, A=100):
320328
`p` for which the mod-`p` representation is reducible, and [0]
321329
is returned::
322330
323-
sage: K.<a> = NumberField(x^2-x+1)
331+
sage: K.<a> = NumberField(x^2 - x + 1)
324332
sage: E = EllipticCurve([0,0,0,0,a])
325333
sage: E.has_rational_cm()
326334
True
@@ -403,7 +411,7 @@ def reducible_primes(self):
403411
`p` for which the mod-`p` representation is reducible, and [0]
404412
is returned::
405413
406-
sage: K.<a> = NumberField(x^2-x+1)
414+
sage: K.<a> = NumberField(x^2 - x + 1)
407415
sage: E = EllipticCurve([0,0,0,0,a])
408416
sage: E.has_rational_cm()
409417
True
@@ -426,7 +434,7 @@ def _non_surjective(E, patience=100):
426434
- ``E`` -- EllipticCurve (over a number field).
427435
428436
- ``A`` -- int (a bound on the number of traces of Frobenius to use
429-
while trying to prove surjectivity).
437+
while trying to prove surjectivity).
430438
431439
OUTPUT:
432440
@@ -848,7 +856,8 @@ def _semistable_reducible_primes(E, verbose=False):
848856
849857
sage: x = polygen(ZZ, 'x')
850858
sage: K.<a> = NumberField(x^5 - 6*x^3 + 8*x - 1)
851-
sage: E = EllipticCurve(K, [a^3 - 2*a, a^4 - 2*a^3 - 4*a^2 + 6*a + 1, a + 1, -a^3 + a + 1, -a])
859+
sage: E = EllipticCurve(K, [a^3 - 2*a, a^4 - 2*a^3 - 4*a^2 + 6*a + 1,
860+
....: a + 1, -a^3 + a + 1, -a])
852861
sage: from sage.schemes.elliptic_curves.gal_reps_number_field import _semistable_reducible_primes
853862
sage: _semistable_reducible_primes(E)
854863
[2, 5, 53, 1117]
@@ -1406,7 +1415,7 @@ def Billerey_R_bound(E, max_l=200, num_l=8, small_prime_bound=None, debug=False)
14061415
14071416
.. NOTE::
14081417
1409-
The purpose of the small_prime_bound is that it is faster to
1418+
The purpose of the ``small_prime_bound`` is that it is faster to
14101419
deal with these using the local test; by ignoring them here,
14111420
we enable the algorithm to terminate sooner when there are no
14121421
large reducible primes, which is always the case in practice.

0 commit comments

Comments
 (0)