Skip to content

Commit

Permalink
sagemathgh-38443: fix E302 in pxi files
Browse files Browse the repository at this point in the history
    
just for the sake of house cleaning


### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#38443
Reported by: Frédéric Chapoton
Reviewer(s): Martin Rubey
  • Loading branch information
Release Manager committed Aug 2, 2024
2 parents f216576 + 87dea4a commit 4219d0c
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sage/data_structures/list_of_pairs.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cdef struct pair_s:
size_t first
size_t second


@cython.final
cdef class ListOfPairs:
cdef pair_s** _lists
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/linkages/padics/unram_shared.pxi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cimport cython


@cython.binding(True)
def frobenius_unram(self, arithmetic=True):
"""
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/symmetrica/kostka.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cdef extern from 'symmetrica/def.h':
INT kostka_tab(OP shape, OP content, OP result)
INT kostka_tafel(OP n, OP result)


def kostka_number_symmetrica(shape, content):
"""
Compute the kostkanumber, i.e. the number of
Expand Down Expand Up @@ -53,6 +54,7 @@ def kostka_number_symmetrica(shape, content):

return res


def kostka_tab_symmetrica(shape, content):
"""
Compute the list of tableaux of given shape
Expand Down Expand Up @@ -111,6 +113,7 @@ def kostka_tab_symmetrica(shape, content):

return res


def kostka_tafel_symmetrica(n):
"""
Return the table of Kostka numbers of weight `n`.
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/symmetrica/part.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cdef extern from 'symmetrica/def.h':
INT gupta_tafel(OP max, OP res)
INT random_partition(OP nx, OP res)


def strict_to_odd_part_symmetrica(part):
"""
Implement the bijection between strict partitions
Expand Down Expand Up @@ -36,6 +37,7 @@ def strict_to_odd_part_symmetrica(part):

return res


def odd_to_strict_part_symmetrica(part):
"""
Implement the bijection between partitions with odd parts
Expand Down Expand Up @@ -129,6 +131,7 @@ def gupta_nm_symmetrica(n, m):

return res


def gupta_tafel_symmetrica(max):
"""
It computes the table of the above values. The entry
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/symmetrica/plet.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cdef extern from 'symmetrica/def.h':
INT plethysm(OP s1, OP s2, OP res)
INT schur_schur_plet(OP p1, OP p2, OP res)


def plethysm_symmetrica(outer, inner):
cdef OP couter = callocobject(), cinner = callocobject(), cresult = callocobject()

Expand Down
2 changes: 2 additions & 0 deletions src/sage/libs/symmetrica/sab.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def sdg_symmetrica(part, perm):

return res


def odg_symmetrica(part, perm):
"""
Calculate the irreducible matrix representation
Expand Down Expand Up @@ -140,6 +141,7 @@ def ndg_symmetrica(part, perm):

return res


def specht_dg_symmetrica(part, perm):
cdef OP cpart, cperm, cD

Expand Down
4 changes: 4 additions & 0 deletions src/sage/libs/symmetrica/sb.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def mult_schubert_schubert_symmetrica(a, b):

return res


def t_SCHUBERT_POLYNOM_symmetrica(a):
"""
Convert a Schubert polynomial to a 'regular' multivariate
Expand Down Expand Up @@ -96,6 +97,7 @@ def t_SCHUBERT_POLYNOM_symmetrica(a):

return res


def t_POLYNOM_SCHUBERT_symmetrica(a):
"""
Convert a multivariate polynomial a to a Schubert polynomial.
Expand Down Expand Up @@ -135,6 +137,7 @@ def t_POLYNOM_SCHUBERT_symmetrica(a):

return res


def mult_schubert_variable_symmetrica(a, i):
"""
Return the product of `a` and `x_i`. Note that indexing with `i`
Expand Down Expand Up @@ -270,6 +273,7 @@ def scalarproduct_schubert_symmetrica(a, b):

return res


def divdiff_schubert_symmetrica(i, a):
r"""
Return the result of applying the divided difference operator
Expand Down
12 changes: 12 additions & 0 deletions src/sage/libs/symmetrica/schur.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def compute_schur_with_alphabet_det_symmetrica(part, length, alphabet='x'):

return res


def part_part_skewschur_symmetrica(outer, inner):
"""
Return the skew Schur function s_{outer/inner}.
Expand All @@ -430,6 +431,7 @@ def part_part_skewschur_symmetrica(outer, inner):

return res


def hall_littlewood_symmetrica(part):
"""
Compute the so called Hall Littlewood Polynomials, i.e.
Expand Down Expand Up @@ -526,6 +528,7 @@ def t_SCHUR_POWSYM_symmetrica(schur):

return res


def t_POLYNOM_SCHUR_symmetrica(p):
r"""
Convert a symmetric polynomial with base ring `\QQ` or `\ZZ` into a
Expand Down Expand Up @@ -566,6 +569,7 @@ def t_MONOMIAL_HOMSYM_symmetrica(monomial):

return res


def t_MONOMIAL_ELMSYM_symmetrica(monomial):
cdef OP cmonomial = callocobject(), cresult = callocobject()

Expand Down Expand Up @@ -616,6 +620,7 @@ def t_MONOMIAL_POWSYM_symmetrica(monomial):

return res


def t_POLYNOM_MONOMIAL_symmetrica(p):
r"""
Convert a symmetric polynomial with base ring `\QQ` or `\ZZ` into a
Expand Down Expand Up @@ -673,6 +678,7 @@ def t_ELMSYM_POWSYM_symmetrica(elmsym):

return res


def t_ELMSYM_MONOMIAL_symmetrica(elmsym):
cdef OP celmsym = callocobject(), cresult = callocobject()

Expand Down Expand Up @@ -706,6 +712,7 @@ def t_ELMSYM_HOMSYM_symmetrica(elmsym):

return res


def t_POLYNOM_ELMSYM_symmetrica(p):
r"""
Convert a symmetric polynomial with base ring `\QQ` or `\ZZ` into a
Expand Down Expand Up @@ -746,6 +753,7 @@ def t_HOMSYM_SCHUR_symmetrica(homsym):

return res


def t_HOMSYM_POWSYM_symmetrica(homsym):
cdef OP chomsym = callocobject(), cresult = callocobject()

Expand Down Expand Up @@ -779,6 +787,7 @@ def t_HOMSYM_MONOMIAL_symmetrica(homsym):

return res


def t_HOMSYM_ELMSYM_symmetrica(homsym):
cdef OP chomsym = callocobject(), cresult = callocobject()

Expand Down Expand Up @@ -829,6 +838,7 @@ def t_POWSYM_SCHUR_symmetrica(powsym):

return res


def t_POWSYM_ELMSYM_symmetrica(powsym):
cdef OP cpowsym = callocobject(), cresult = callocobject()

Expand All @@ -845,6 +855,7 @@ def t_POWSYM_ELMSYM_symmetrica(powsym):

return res


def t_POWSYM_HOMSYM_symmetrica(powsym):
cdef OP cpowsym = callocobject(), cresult = callocobject()

Expand All @@ -861,6 +872,7 @@ def t_POWSYM_HOMSYM_symmetrica(powsym):

return res


def t_POLYNOM_POWER_symmetrica(p):
r"""
Convert a symmetric polynomial with base ring `\QQ` or `\ZZ` into a
Expand Down
1 change: 1 addition & 0 deletions src/sage/libs/symmetrica/symmetrica.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ cdef int _op(object a, OP result) except -1:
else:
raise TypeError("cannot convert a (= %s) to OP" % a)


def test_integer(object x):
"""
Test functionality for converting between Sage's integers
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/polynomial/polynomial_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ from sage.libs.pari.all import pari_gen

import operator


def make_element(parent, args):
return parent(*args)


cdef inline Polynomial_template element_shift(self, int n):
if not isinstance(self, Polynomial_template):
if n > 0:
Expand Down
1 change: 1 addition & 0 deletions src/sage/symbolic/getitem_impl.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ cdef class OperandsWrapper(SageObject):
"""
return restore_op_wrapper, (self._expr,)


def restore_op_wrapper(expr):
"""
TESTS::
Expand Down
13 changes: 13 additions & 0 deletions src/sage/symbolic/pynac_impl.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,7 @@ cdef py_numer(n):
except AttributeError:
return n


def py_numer_for_doctests(n):
"""
This function is used to test py_numer().
Expand Down Expand Up @@ -1390,6 +1391,7 @@ cdef py_float(n, PyObject* kwds):
except TypeError:
return CC(n)


def py_float_for_doctests(n, kwds):
"""
This function is for testing py_float.
Expand Down Expand Up @@ -1450,6 +1452,7 @@ cdef py_tgamma(x):
return CC(res)
return res


def py_tgamma_for_doctests(x):
"""
This function is for testing py_tgamma().
Expand Down Expand Up @@ -1489,6 +1492,7 @@ cdef py_factorial(x):
else:
return py_tgamma(x+1)


def py_factorial_py(x):
"""
This function is a python wrapper around py_factorial(). This wrapper
Expand All @@ -1510,6 +1514,7 @@ cdef py_doublefactorial(x):
from sage.misc.misc_c import prod # fast balanced product
return prod([n - 2*i for i in range(n//2)])


def doublefactorial(n):
"""
The double factorial combinatorial function:
Expand Down Expand Up @@ -1630,6 +1635,7 @@ cdef py_stieltjes(x):
prec = 53
return mpmath_utils.call(mpmath.stieltjes, n, prec=prec)


def py_stieltjes_for_doctests(x):
"""
This function is for testing py_stieltjes().
Expand Down Expand Up @@ -1664,6 +1670,7 @@ cdef py_zeta(x):
except AttributeError:
return CC(x).zeta()


def py_zeta_for_doctests(x):
"""
This function is for testing py_zeta().
Expand Down Expand Up @@ -1705,6 +1712,7 @@ cdef py_exp(x):
except (TypeError, ValueError):
return CC(x).exp()


def py_exp_for_doctests(x):
"""
This function tests py_exp.
Expand Down Expand Up @@ -1774,6 +1782,7 @@ cdef py_log(x):
except (TypeError, ValueError):
return CC(x).log()


def py_log_for_doctests(x):
"""
This function tests py_log.
Expand Down Expand Up @@ -2195,6 +2204,7 @@ cdef py_psi2(n, x):
prec = 53
return mpmath_utils.call(mpmath.psi, n, x, prec=prec)


def py_psi2_for_doctests(n, x):
"""
This function is a python wrapper so py_psi2 can be tested. The real tests
Expand Down Expand Up @@ -2268,6 +2278,7 @@ cdef py_eval_unsigned_infinity():
from sage.rings.infinity import unsigned_infinity
return unsigned_infinity


def py_eval_unsigned_infinity_for_doctests():
"""
This function tests py_eval_unsigned_infinity.
Expand All @@ -2287,6 +2298,7 @@ cdef py_eval_infinity():
from sage.rings.infinity import infinity
return infinity


def py_eval_infinity_for_doctests():
"""
This function tests py_eval_infinity.
Expand All @@ -2306,6 +2318,7 @@ cdef py_eval_neg_infinity():
from sage.rings.infinity import minus_infinity
return minus_infinity


def py_eval_neg_infinity_for_doctests():
"""
This function tests py_eval_neg_infinity.
Expand Down

0 comments on commit 4219d0c

Please sign in to comment.