Skip to content

Commit 17f07d5

Browse files
author
Release Manager
committed
gh-36371: fix remaining W605 warnings in pxi files This is fixing the few remaining W605 warnings issued by cython-lint, in some pxi files. This is outside of rings/padics, handled in another place. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36371 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents d8e5529 + ec9ac7f commit 17f07d5

File tree

7 files changed

+44
-55
lines changed

7 files changed

+44
-55
lines changed

src/sage/libs/linkages/padics/API.pxi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ cdef inline long chash(celement a, long ordp, long prec, PowComputer_class prime
469469

470470
# the expansion_mode enum is defined in padic_template_element_header.pxi
471471
cdef inline cexpansion_next(celement value, expansion_mode mode, long curpower, PowComputer_ prime_pow):
472-
"""
472+
r"""
473473
Return the next digit in a `\pi`-adic expansion of ``value``.
474474
475475
INPUT:
@@ -483,7 +483,7 @@ cdef inline cexpansion_next(celement value, expansion_mode mode, long curpower,
483483
pass
484484

485485
cdef inline cexpansion_getitem(celement value, long m, PowComputer_ prime_pow):
486-
"""
486+
r"""
487487
Return the `m`th `\pi`-adic digit in the ``simple_mode`` expansion.
488488
489489
INPUT:
@@ -512,7 +512,7 @@ cdef list ccoefficients(celement x, long valshift, PowComputer_class prime_pow):
512512
pass
513513

514514
cdef int cteichmuller(celement out, celement value, long prec, PowComputer_class prime_pow) except -1:
515-
"""
515+
r"""
516516
Teichmuller lifting.
517517
518518
INPUT:

src/sage/libs/linkages/padics/fmpz_poly_unram.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ cdef list ccoefficients(celement x, long valshift, long prec, PowComputer_ prime
668668
return ans
669669

670670
cdef int cteichmuller(celement out, celement value, long prec, PowComputer_ prime_pow) except -1:
671-
"""
671+
r"""
672672
Teichmuller lifting.
673673
674674
INPUT:
@@ -848,7 +848,7 @@ cdef inline int cconv_mpz_t_out(mpz_t out, celement x, long valshift, long prec,
848848
## Extra functions ##
849849

850850
cdef cmatrix_mod_pn(celement a, long aprec, long valshift, PowComputer_ prime_pow):
851-
"""
851+
r"""
852852
Returns the matrix of right multiplication by the element on
853853
the power basis `1, x, x^2, \ldots, x^{d-1}` for this
854854
extension field. Thus the *rows* of this matrix give the

src/sage/libs/linkages/padics/mpz.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ cdef list ccoefficients(mpz_t x, long valshift, long prec, PowComputer_ prime_po
568568
return [ansq]
569569

570570
cdef int cteichmuller(mpz_t out, mpz_t value, long prec, PowComputer_ prime_pow) except -1:
571-
"""
571+
r"""
572572
Teichmuller lifting.
573573
574574
INPUT:

src/sage/libs/linkages/padics/unram_shared.pxi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cimport cython
33
@cython.binding(True)
44
def frobenius_unram(self, arithmetic=True):
55
"""
6-
Returns the image of this element under the Frobenius automorphism
6+
Return the image of this element under the Frobenius automorphism
77
applied to its parent.
88
99
INPUT:
@@ -48,9 +48,9 @@ def frobenius_unram(self, arithmetic=True):
4848
...
4949
NotImplementedError: Frobenius automorphism only implemented for unramified extensions
5050
51-
TESTS::
51+
TESTS:
5252
53-
We check that :trac:`23575` is resolved:
53+
We check that :trac:`23575` is resolved::
5454
5555
sage: x = R.random_element()
5656
sage: x.frobenius(arithmetic=false).frobenius() == x
@@ -84,7 +84,7 @@ def frobenius_unram(self, arithmetic=True):
8484

8585
@cython.binding(True)
8686
def norm_unram(self, base = None):
87-
"""
87+
r"""
8888
Return the absolute or relative norm of this element.
8989
9090
.. WARNING::
@@ -95,9 +95,9 @@ def norm_unram(self, base = None):
9595
9696
INPUT:
9797
98-
``base`` -- a subfield of the parent `L` of this element.
99-
The norm is the relative norm from ``L`` to ``base``.
100-
Defaults to the absolute norm down to `\QQ_p` or `\ZZ_p`.
98+
- ``base`` -- a subfield of the parent `L` of this element.
99+
The norm is the relative norm from ``L`` to ``base``.
100+
Defaults to the absolute norm down to `\QQ_p` or `\ZZ_p`.
101101
102102
EXAMPLES::
103103
@@ -171,7 +171,7 @@ def norm_unram(self, base = None):
171171

172172
@cython.binding(True)
173173
def trace_unram(self, base = None):
174-
"""
174+
r"""
175175
Return the absolute or relative trace of this element.
176176
177177
If ``base`` is given then ``base`` must be a subfield of the

src/sage/libs/symmetrica/sc.pxi

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cdef extern from 'symmetrica/def.h':
44
INT kranztafel(OP a, OP b, OP res, OP co, OP cl)
55
INT c_ijk_sn(OP i, OP j, OP k, OP res)
66

7+
78
def chartafel_symmetrica(n):
89
"""
910
you enter the degree of the symmetric group, as INTEGER
@@ -22,8 +23,7 @@ def chartafel_symmetrica(n):
2223
[ 0 -1 2 0 2]
2324
[ 1 0 -1 -1 3]
2425
[-1 1 1 -1 1]
25-
"""
26-
26+
"""
2727
cdef OP cn, cres
2828

2929
cn = callocobject()
@@ -41,7 +41,6 @@ def chartafel_symmetrica(n):
4141
return res
4242

4343

44-
4544
def charvalue_symmetrica(irred, cls, table=None):
4645
"""
4746
you enter a PARTITION object part, labelling the irreducible
@@ -67,10 +66,8 @@ def charvalue_symmetrica(irred, cls, table=None):
6766
sage: m == symmetrica.chartafel(n)
6867
True
6968
"""
70-
7169
cdef OP cirred, cclass, ctable, cresult
7270

73-
7471
cirred = callocobject()
7572
cclass = callocobject()
7673
cresult = callocobject()
@@ -81,8 +78,6 @@ def charvalue_symmetrica(irred, cls, table=None):
8178
ctable = callocobject()
8279
_op_matrix(table, ctable)
8380

84-
85-
8681
#FIXME: assume that class is a partition
8782
_op_partition(cls, cclass)
8883

@@ -101,42 +96,38 @@ def charvalue_symmetrica(irred, cls, table=None):
10196
return res
10297

10398

104-
10599
def kranztafel_symmetrica(a, b):
106-
"""
107-
you enter the INTEGER objects, say a and b, and res becomes a
108-
MATRIX object, the charactertable of S_b \wr S_a, co becomes a
109-
VECTOR object of classorders and cl becomes a VECTOR object of
100+
r"""
101+
you enter the INTEGER objects, say `a` and `b`, and ``res`` becomes a
102+
MATRIX object, the charactertable of `S_b \wr S_a`, ``co`` becomes a
103+
VECTOR object of classorders and ``cl`` becomes a VECTOR object of
110104
the classlabels.
111105
112106
EXAMPLES::
113107
114-
sage: (a,b,c) = symmetrica.kranztafel(2,2)
115-
sage: a
116-
[ 1 -1 1 -1 1]
117-
[ 1 1 1 1 1]
118-
[-1 1 1 -1 1]
119-
[ 0 0 2 0 -2]
120-
[-1 -1 1 1 1]
121-
sage: b
122-
[2, 2, 1, 2, 1]
123-
sage: for m in c: print(m)
124-
[0 0]
125-
[0 1]
126-
[0 0]
127-
[1 0]
128-
[0 2]
129-
[0 0]
130-
[1 1]
131-
[0 0]
132-
[2 0]
133-
[0 0]
134-
108+
sage: (a,b,c) = symmetrica.kranztafel(2,2)
109+
sage: a
110+
[ 1 -1 1 -1 1]
111+
[ 1 1 1 1 1]
112+
[-1 1 1 -1 1]
113+
[ 0 0 2 0 -2]
114+
[-1 -1 1 1 1]
115+
sage: b
116+
[2, 2, 1, 2, 1]
117+
sage: for m in c: print(m)
118+
[0 0]
119+
[0 1]
120+
[0 0]
121+
[1 0]
122+
[0 2]
123+
[0 0]
124+
[1 1]
125+
[0 0]
126+
[2 0]
127+
[0 0]
135128
"""
136-
137129
cdef OP ca, cb, cres, cco, ccl
138130

139-
140131
ca = callocobject()
141132
cb = callocobject()
142133
cres = callocobject()
@@ -194,4 +185,3 @@ def kranztafel_symmetrica(a, b):
194185
## freeall(ck)
195186

196187
## return res
197-

src/sage/matrix/matrix_modn_dense_template.pxi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
Dense matrices over `\ZZ/n\ZZ` for `n` small using the LinBox library (FFLAS/FFPACK)
33
44
FFLAS/FFPACK are libraries to provide BLAS/LAPACK-style routines for
@@ -857,7 +857,7 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
857857

858858

859859
cpdef _add_(self, right):
860-
"""
860+
r"""
861861
Add two dense matrices over `\Z/n\Z`
862862
863863
INPUT:
@@ -2284,7 +2284,7 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
22842284
return Matrix_dense.determinant(self)
22852285

22862286
cdef xgcd_eliminate(self, celement * row1, celement* row2, Py_ssize_t start_col):
2287-
"""
2287+
r"""
22882288
Reduces ``row1`` and ``row2`` by a unimodular transformation
22892289
using the xgcd relation between their first coefficients ``a`` and
22902290
``b``.
@@ -2298,7 +2298,6 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
22982298
``row2``. It is assumed that all entries before ``start_col``
22992299
in ``row1`` and ``row2`` are zero.
23002300
2301-
23022301
OUTPUT:
23032302
23042303
- g: the gcd of the first elements of row1 and

src/sage/symbolic/series_impl.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
Symbolic Series
33
44
Symbolic series are special kinds of symbolic expressions that are

0 commit comments

Comments
 (0)