Skip to content

Commit

Permalink
fix E302 in pxi files
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jul 28, 2024
1 parent 79c047c commit 87dea4a
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):
"""
computes 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):
"""
computes the list of tableaux of given shape
Expand Down Expand Up @@ -113,6 +115,7 @@ def kostka_tab_symmetrica(shape, content):

return res


def kostka_tafel_symmetrica(n):
"""
Returns 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):
"""
implements the bijection between strict partitions
Expand Down Expand Up @@ -37,6 +38,7 @@ def strict_to_odd_part_symmetrica(part):

return res


def odd_to_strict_part_symmetrica(part):
"""
implements the bijection between partitions with odd parts
Expand Down Expand Up @@ -131,6 +133,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):
"""
"""
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):
"""
Calculates the irreducible matrix representation
Expand Down Expand Up @@ -144,6 +145,7 @@ def ndg_symmetrica(part, perm):

return res


def specht_dg_symmetrica(part, perm):
"""
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):
"""
Converts 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):
"""
Converts 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):
"""
Returns 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"""
Returns 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 @@ -408,6 +408,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 @@ -434,6 +435,7 @@ def part_part_skewschur_symmetrica(outer, inner):

return res


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

return res


def t_POLYNOM_SCHUR_symmetrica(p):
"""
Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function
Expand Down Expand Up @@ -587,6 +590,7 @@ def t_MONOMIAL_HOMSYM_symmetrica(monomial):

return res


def t_MONOMIAL_ELMSYM_symmetrica(monomial):
"""
Expand Down Expand Up @@ -649,6 +653,7 @@ def t_MONOMIAL_POWSYM_symmetrica(monomial):

return res


def t_POLYNOM_MONOMIAL_symmetrica(p):
"""
Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function
Expand Down Expand Up @@ -714,6 +719,7 @@ def t_ELMSYM_POWSYM_symmetrica(elmsym):

return res


def t_ELMSYM_MONOMIAL_symmetrica(elmsym):
"""
Expand Down Expand Up @@ -755,6 +761,7 @@ def t_ELMSYM_HOMSYM_symmetrica(elmsym):

return res


def t_POLYNOM_ELMSYM_symmetrica(p):
"""
Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function
Expand Down Expand Up @@ -799,6 +806,7 @@ def t_HOMSYM_SCHUR_symmetrica(homsym):

return res


def t_HOMSYM_POWSYM_symmetrica(homsym):
"""
Expand Down Expand Up @@ -840,6 +848,7 @@ def t_HOMSYM_MONOMIAL_symmetrica(homsym):

return res


def t_HOMSYM_ELMSYM_symmetrica(homsym):
"""
Expand Down Expand Up @@ -902,6 +911,7 @@ def t_POWSYM_SCHUR_symmetrica(powsym):

return res


def t_POWSYM_ELMSYM_symmetrica(powsym):
"""
Expand All @@ -922,6 +932,7 @@ def t_POWSYM_ELMSYM_symmetrica(powsym):

return res


def t_POWSYM_HOMSYM_symmetrica(powsym):
"""
Expand All @@ -942,6 +953,7 @@ def t_POWSYM_HOMSYM_symmetrica(powsym):

return res


def t_POLYNOM_POWER_symmetrica(p):
"""
Converts a symmetric polynomial with base ring QQ or ZZ into a symmetric function
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):
"""
Tests 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 @@ -1286,6 +1286,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 @@ -1397,6 +1398,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 @@ -1457,6 +1459,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 @@ -1496,6 +1499,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 @@ -1517,6 +1521,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 @@ -1637,6 +1642,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 @@ -1671,6 +1677,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 @@ -1712,6 +1719,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 @@ -1781,6 +1789,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 @@ -2202,6 +2211,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 @@ -2276,6 +2286,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 @@ -2295,6 +2306,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 @@ -2314,6 +2326,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 87dea4a

Please sign in to comment.