Skip to content

Commit d3d43be

Browse files
author
Release Manager
committed
Trac #34592: fix W605 in libs and rings/semirings
in pyx files, as py files are already ok URL: https://trac.sagemath.org/34592 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Travis Scrimshaw
2 parents fcc132c + 1205fc8 commit d3d43be

17 files changed

+197
-140
lines changed

src/sage/libs/eclib/mwrank.pyx

+38-40
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ mwrank_set_precision(150)
8383

8484
def get_precision():
8585
"""
86-
Returns the working floating point bit precision of mwrank, which is
86+
Return the working floating point bit precision of mwrank, which is
8787
equal to the global NTL real number precision.
8888
8989
OUTPUT:
@@ -119,7 +119,7 @@ def set_precision(n):
119119
This change is global and affects *all* future calls of eclib
120120
functions by Sage.
121121
122-
.. note::
122+
.. NOTE::
123123
124124
The minimal value to which the precision may be set is 53.
125125
Lower values will be increased to 53.
@@ -335,7 +335,7 @@ cdef class _Curvedata: # cython class wrapping eclib's Curvedata class
335335
return string_sigoff(Curvedata_repr(self.x))[:-1]
336336

337337
def silverman_bound(self):
338-
"""
338+
r"""
339339
The Silverman height bound for this elliptic curve.
340340
341341
OUTPUT:
@@ -345,7 +345,7 @@ cdef class _Curvedata: # cython class wrapping eclib's Curvedata class
345345
+ B`, where `h(P)` is the naive height and `\hat{h}(P)` the
346346
canonical height.
347347
348-
.. note::
348+
.. NOTE::
349349
350350
Since eclib can compute this to arbitrary precision, we
351351
could return a Sage real, but this is only a bound and in
@@ -364,7 +364,7 @@ cdef class _Curvedata: # cython class wrapping eclib's Curvedata class
364364
return Curvedata_silverman_bound(self.x)
365365

366366
def cps_bound(self):
367-
"""
367+
r"""
368368
The Cremona-Prickett-Siksek height bound for this elliptic curve.
369369
370370
OUTPUT:
@@ -374,12 +374,11 @@ cdef class _Curvedata: # cython class wrapping eclib's Curvedata class
374374
+ B`, where `h(P)` is the naive height and `\hat{h}(P)` the
375375
canonical height.
376376
377-
.. note::
377+
.. NOTE::
378378
379-
Since eclib can compute this to arbitrary precision, we
379+
Since ``eclib`` can compute this to arbitrary precision, we
380380
could return a Sage real, but this is only a bound and in
381-
the contexts in which it is used extra precision is
382-
irrelevant.
381+
the contexts in which it is used extra precision is irrelevant.
383382
384383
EXAMPLES::
385384
@@ -399,7 +398,7 @@ cdef class _Curvedata: # cython class wrapping eclib's Curvedata class
399398
return x
400399

401400
def height_constant(self):
402-
"""
401+
r"""
403402
A height bound for this elliptic curve.
404403
405404
OUTPUT:
@@ -410,12 +409,11 @@ cdef class _Curvedata: # cython class wrapping eclib's Curvedata class
410409
canonical height. This is the minimum of the Silverman and
411410
Cremona_Prickett-Siksek height bounds.
412411
413-
.. note::
412+
.. NOTE::
414413
415-
Since eclib can compute this to arbitrary precision, we
414+
Since ``eclib`` can compute this to arbitrary precision, we
416415
could return a Sage real, but this is only a bound and in
417-
the contexts in which it is used extra precision is
418-
irrelevant.
416+
the contexts in which it is used extra precision is irrelevant.
419417
420418
EXAMPLES::
421419
@@ -542,7 +540,7 @@ cdef class _mw:
542540
cdef int verb
543541

544542
def __init__(self, _Curvedata curve, verb=False, pp=1, maxr=999):
545-
"""
543+
r"""
546544
Constructor for mw class.
547545
548546
INPUT:
@@ -704,10 +702,10 @@ cdef class _mw:
704702
705703
.. NOTE::
706704
707-
The eclib function which implements this only carries out
708-
any saturation if the rank of the points increases upon
709-
adding the new point. This is because it is assumed that
710-
one saturates as ones goes along.
705+
The eclib function which implements this only carries out
706+
any saturation if the rank of the points increases upon
707+
adding the new point. This is because it is assumed that
708+
one saturates as ones goes along.
711709
712710
EXAMPLES::
713711
@@ -753,7 +751,7 @@ cdef class _mw:
753751

754752
def getbasis(self):
755753
"""
756-
Returns the current basis of the mw structure.
754+
Return the current basis of the mw structure.
757755
758756
OUTPUT:
759757
@@ -778,7 +776,7 @@ cdef class _mw:
778776

779777
def regulator(self):
780778
"""
781-
Returns the regulator of the current basis of the mw group.
779+
Return the regulator of the current basis of the mw group.
782780
783781
OUTPUT:
784782
@@ -810,7 +808,7 @@ cdef class _mw:
810808

811809
def rank(self):
812810
"""
813-
Returns the rank of the current basis of the mw group.
811+
Return the rank of the current basis of the mw group.
814812
815813
OUTPUT:
816814
@@ -908,7 +906,7 @@ cdef class _mw:
908906
return ok, index, unsat
909907

910908
def search(self, h_lim, int moduli_option=0, int verb=0):
911-
"""
909+
r"""
912910
Search for points in the mw group.
913911
914912
INPUT:
@@ -926,17 +924,16 @@ cdef class _mw:
926924
927925
.. NOTE::
928926
929-
The effect of the search is also governed by the class
930-
options, notably whether the points found are processed:
931-
meaning that linear relations are found and saturation is
932-
carried out, with the result that the list of generators
933-
will always contain a `\ZZ`-span of the saturation of the
934-
points found, modulo torsion.
927+
The effect of the search is also governed by the class
928+
options, notably whether the points found are processed:
929+
meaning that linear relations are found and saturation is
930+
carried out, with the result that the list of generators
931+
will always contain a `\ZZ`-span of the saturation of the
932+
points found, modulo torsion.
935933
936934
OUTPUT:
937935
938-
None. The effect of the search is to update the list of
939-
generators.
936+
None. The effect of the search is to update the list of generators.
940937
941938
EXAMPLES::
942939
@@ -1069,7 +1066,7 @@ cdef class _two_descent:
10691066

10701067
def getrank(self):
10711068
"""
1072-
Returns the rank (after doing a 2-descent).
1069+
Return the rank (after doing a 2-descent).
10731070
10741071
OUTPUT:
10751072
@@ -1102,7 +1099,7 @@ cdef class _two_descent:
11021099

11031100
def getrankbound(self):
11041101
"""
1105-
Returns the rank upper bound (after doing a 2-descent).
1102+
Return the rank upper bound (after doing a 2-descent).
11061103
11071104
OUTPUT:
11081105
@@ -1135,7 +1132,7 @@ cdef class _two_descent:
11351132

11361133
def getselmer(self):
11371134
"""
1138-
Returns the 2-Selmer rank (after doing a 2-descent).
1135+
Return the 2-Selmer rank (after doing a 2-descent).
11391136
11401137
OUTPUT:
11411138
@@ -1167,7 +1164,7 @@ cdef class _two_descent:
11671164

11681165
def ok(self):
11691166
"""
1170-
Returns the success flag (after doing a 2-descent).
1167+
Return the success flag (after doing a 2-descent).
11711168
11721169
OUTPUT:
11731170
@@ -1196,7 +1193,7 @@ cdef class _two_descent:
11961193

11971194
def getcertain(self):
11981195
"""
1199-
Returns the certainty flag (after doing a 2-descent).
1196+
Return the certainty flag (after doing a 2-descent).
12001197
12011198
OUTPUT:
12021199
@@ -1273,16 +1270,17 @@ cdef class _two_descent:
12731270
sig_off()
12741271

12751272
def getbasis(self):
1276-
"""
1277-
Returns the basis of points found by doing a 2-descent.
1273+
r"""
1274+
Return the basis of points found by doing a 2-descent.
12781275
12791276
If the success and certain flags are 1, this will be a
12801277
`\ZZ/2\ZZ`-basis for `E(\QQ)/2E(\QQ)` (modulo torsion),
12811278
otherwise possibly only for a proper subgroup.
12821279
12831280
.. NOTE::
12841281
1285-
You must call ``saturate()`` first, or a RunTimeError will be raised.
1282+
You must call ``saturate()`` first, or a ``RunTimeError``
1283+
will be raised.
12861284
12871285
OUTPUT:
12881286
@@ -1320,7 +1318,7 @@ cdef class _two_descent:
13201318

13211319
def regulator(self):
13221320
"""
1323-
Returns the regulator of the points found by doing a 2-descent.
1321+
Return the regulator of the points found by doing a 2-descent.
13241322
13251323
OUTPUT:
13261324

src/sage/libs/eclib/newforms.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ from sage.modular.all import Cusp
2222

2323

2424
cdef class ECModularSymbol:
25-
"""
25+
r"""
2626
Modular symbol associated with an elliptic curve, using John Cremona's newforms class.
2727
2828
EXAMPLES::

src/sage/libs/ntl/ntl_GF2.pyx

+12
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ cdef class ntl_GF2():
116116

117117
def __mul__(self, other):
118118
"""
119+
EXAMPLES::
120+
119121
sage: o = ntl.GF2(1)
120122
sage: z = ntl.GF2(0)
121123
sage: o*o
@@ -137,6 +139,8 @@ cdef class ntl_GF2():
137139

138140
def __truediv__(self, other):
139141
"""
142+
EXAMPLES::
143+
140144
sage: o = ntl.GF2(1)
141145
sage: z = ntl.GF2(0)
142146
sage: o/o
@@ -159,6 +163,8 @@ cdef class ntl_GF2():
159163

160164
def __sub__(self, other):
161165
"""
166+
EXAMPLES::
167+
162168
sage: o = ntl.GF2(1)
163169
sage: z = ntl.GF2(0)
164170
sage: o-o
@@ -180,6 +186,8 @@ cdef class ntl_GF2():
180186

181187
def __add__(self, other):
182188
"""
189+
EXAMPLES::
190+
183191
sage: o = ntl.GF2(1)
184192
sage: z = ntl.GF2(0)
185193
sage: o+o
@@ -201,6 +209,8 @@ cdef class ntl_GF2():
201209

202210
def __neg__(ntl_GF2 self):
203211
"""
212+
EXAMPLES::
213+
204214
sage: o = ntl.GF2(1)
205215
sage: z = ntl.GF2(0)
206216
sage: -z
@@ -214,6 +224,8 @@ cdef class ntl_GF2():
214224

215225
def __pow__(ntl_GF2 self, long e, ignored):
216226
"""
227+
EXAMPLES::
228+
217229
sage: o = ntl.GF2(1)
218230
sage: z = ntl.GF2(0)
219231
sage: z^2

src/sage/libs/ntl/ntl_GF2E.pyx

+16-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# distutils: extra_link_args = NTL_LIBEXTRA
66
# distutils: language = c++
77

8-
#*****************************************************************************
8+
# ****************************************************************************
99
# Copyright (C) 2005 William Stein <[email protected]>
1010
# Copyright (C) 2007 Martin Albrecht <[email protected]>
1111
#
@@ -18,8 +18,8 @@
1818
#
1919
# The full text of the GPL is available at:
2020
#
21-
# http://www.gnu.org/licenses/
22-
#*****************************************************************************
21+
# https://www.gnu.org/licenses/
22+
# ****************************************************************************
2323

2424
from sage.ext.cplusplus cimport ccrepr
2525

@@ -73,7 +73,7 @@ def ntl_GF2E_random(ntl_GF2EContext_class ctx):
7373

7474
cdef class ntl_GF2E():
7575
r"""
76-
The \\class{GF2E} represents a finite extension field over GF(2)
76+
The :class:`GF2E` represents a finite extension field over GF(2)
7777
using NTL. Elements are represented as polynomials over GF(2)
7878
modulo a modulus.
7979
@@ -164,6 +164,8 @@ cdef class ntl_GF2E():
164164

165165
def __reduce__(self):
166166
"""
167+
EXAMPLES::
168+
167169
sage: ctx = ntl.GF2EContext( ntl.GF2X([1,1,0,1,1,0,0,0,1]) )
168170
sage: a = ntl.GF2E(ntl.ZZ_pX([1,1,3],2), ctx)
169171
sage: loads(dumps(a)) == a
@@ -439,17 +441,20 @@ cdef class ntl_GF2E():
439441
return l
440442

441443
def _sage_(ntl_GF2E self, k=None):
442-
"""
443-
Returns a \class{FiniteFieldElement} representation
444-
of this element. If a \class{FiniteField} k is provided
445-
it is constructed in this field if possible. A \class{FiniteField}
446-
will be constructed if none is provided.
444+
r"""
445+
Return a :class:`FiniteFieldElement` representation of this element.
446+
447+
If a :class:`FiniteField` `k` is provided, it is constructed
448+
in this field if possible. A :class:`FiniteField` will be
449+
constructed if none is provided.
447450
448451
INPUT:
449-
k -- optional GF(2**deg)
452+
453+
- `k` -- (optional) a field `\GF{2^d}`
450454
451455
OUTPUT:
452-
FiniteFieldElement over k
456+
457+
:class:`FiniteFieldElement` over `k`
453458
454459
EXAMPLES::
455460

0 commit comments

Comments
 (0)