Skip to content

Commit

Permalink
sagemathgh-38610: fix and activate E303 check in pyx files
Browse files Browse the repository at this point in the history
    
This is activating the fix for

E303 too many blank lines

in all pyx files.


### 📝 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 and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38610
Reported by: Frédéric Chapoton
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed Sep 13, 2024
2 parents 6e6e84d + 1631dc9 commit 488b258
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 75 deletions.
1 change: 0 additions & 1 deletion src/sage/libs/coxeter3/decl.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ cdef extern from "coxeter/coxtypes.h" namespace "coxtypes":
ctypedef unsigned short Length
ctypedef Ulong StarOp # for numbering star operations


#################
# CoxWord #
#################
Expand Down
1 change: 0 additions & 1 deletion src/sage/libs/ecl.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ cdef extern from "ecl/ecl.h":
ecl_character ecl_char(cl_object s, cl_index i)
ecl_character ecl_char_set(cl_object s, cl_index i, ecl_character c)


# S-expr evaluation and function calls

cl_object cl_safe_eval(cl_object form, cl_object env, cl_object value)
Expand Down
1 change: 0 additions & 1 deletion src/sage/libs/linbox/fflas.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ cdef extern from "fflas-ffpack/fflas-ffpack.h" namespace "FFLAS":
FflasNoTrans
FflasTrans


ctypedef enum FFLAS_SIDE:
FflasRight

Expand Down
1 change: 0 additions & 1 deletion src/sage/libs/m4rie.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ cdef extern from "m4rie/m4rie.h":

void mzd_slice_row_add(mzd_slice_t *A, size_t sourcerow, size_t destrow)


void mzd_slice_row_clear_offset(mzd_slice_t *A, size_t row, size_t coloffset)

void mzd_slice_print(mzd_slice_t *A)
Expand Down
1 change: 0 additions & 1 deletion src/sage/libs/meataxe.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ cdef extern from "meataxe.h":
Matrix_t *MatLoad(char *fn) except? NULL
int MatSave(Matrix_t *mat, char *fn) except -1


## Basic Arithmetic ## general rule: dest is changed, src/mat are unchanged!
Matrix_t *MatTransposed(Matrix_t *src) except NULL
Matrix_t *MatAdd(Matrix_t *dest, Matrix_t *src) except NULL
Expand Down
2 changes: 0 additions & 2 deletions src/sage/libs/ntl/GF2X.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ cdef extern from "ntlwrap.h":
void GF2XModulus_build "build"(GF2XModulus_c F, GF2X_c f) # MUST be called before using the modulus
long GF2XModulus_deg "deg"(GF2XModulus_c F)


GF2X_c GF2XModulus_GF2X "GF2X" (GF2XModulus_c m)

GF2X_c GF2X_IrredPolyMod "IrredPolyMod" (GF2X_c g, GF2XModulus_c F)
Expand All @@ -72,7 +71,6 @@ cdef extern from "ntlwrap.h":
void GF2X_PowerXPlusAMod_pre "PowerXPlusAMod"(GF2X_c x, GF2_c a, GF2_c e, GF2XModulus_c F)
void GF2X_PowerXPlusAMod_long_pre "PowerXPlusAMod"(GF2X_c x, GF2_c a, long e, GF2XModulus_c F)


# x = g(h) mod f; deg(h) < n
void GF2X_CompMod "CompMod"(GF2X_c x, GF2X_c g, GF2X_c h, GF2XModulus_c F)
# xi = gi(h) mod f (i=1,2), deg(h) < n.
Expand Down
5 changes: 0 additions & 5 deletions src/sage/libs/singular/decl.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ cdef extern from "singular/Singular/libsingular.h":
void (*cfWrite)(number* a, const n_Procs_s* r)
void (*cfNormalize)(number* a, const n_Procs_s* r)


bint (*cfDivBy)(number* a, number* b, const n_Procs_s* r)
bint (*cfEqual)(number* a,number* b, const n_Procs_s* )
bint (*cfIsZero)(number* a, const n_Procs_s* ) # algebraic number comparison with zero
Expand All @@ -160,7 +159,6 @@ cdef extern from "singular/Singular/libsingular.h":
bint (*cfGreaterZero)(number* a, const n_Procs_s* )
void (*cfPower)(number* a, int i, number* * result, const n_Procs_s* r) # algebraic number power


ring *extRing
int ch
mpz_ptr modBase
Expand Down Expand Up @@ -211,7 +209,6 @@ cdef extern from "singular/Singular/libsingular.h":
int pCompIndex # index of components
unsigned long bitmask # mask for getting single exponents


n_Procs_s* cf # coefficient field/ring
int ref

Expand Down Expand Up @@ -793,7 +790,6 @@ cdef extern from "singular/Singular/libsingular.h":

number *nlCopy(number *)


# number to integer handle

long SR_TO_INT(number *)
Expand All @@ -813,7 +809,6 @@ cdef extern from "singular/Singular/libsingular.h":

void id_Delete(ideal **, ring *)


# lifting

ideal *idLift(ideal *mod, ideal *submod, ideal **rest, int goodShape, int isSB, int divide)
Expand Down
1 change: 0 additions & 1 deletion src/sage/libs/symmetrica/sb.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def mult_schubert_schubert_symmetrica(a, b):
freeall(cres)
raise err


sig_on()
mult_schubert_schubert(ca, cb, cres)
sig_off()
Expand Down
1 change: 0 additions & 1 deletion src/sage/libs/symmetrica/schur.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ cdef extern from 'symmetrica/def.h':
INT t_HOMSYM_MONOMIAL(OP a, OP b)
INT t_HOMSYM_ELMSYM(OP a, OP b)


INT t_POWSYM_SCHUR(OP a, OP b)
INT t_SCHUR_POWSYM(OP a, OP b)
INT t_POWSYM_HOMSYM(OP a, OP b)
Expand Down
3 changes: 0 additions & 3 deletions src/sage/matrix/matrix_modn_dense_template.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
A.subdivide(*self.subdivisions())
return A


cpdef _add_(self, right):
r"""
Add two dense matrices over `\Z/n\Z`.
Expand Down Expand Up @@ -898,7 +897,6 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
sig_off()
return M


cpdef _sub_(self, right):
r"""
Subtract two dense matrices over `\Z/n\Z`.
Expand Down Expand Up @@ -1404,7 +1402,6 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
self.cache(cache_key, g)
return g


def minpoly(self, var='x', algorithm='linbox', proof=None):
"""
Return the minimal polynomial of ``self``.
Expand Down
15 changes: 0 additions & 15 deletions src/sage/rings/finite_rings/hom_finite_field.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ cdef class SectionFiniteFieldHomomorphism_generic(Section):
return root
raise ValueError("%s is not in the image of %s" % (x, self._inverse))


def _repr_(self):
"""
Return a string representation of this section.
Expand All @@ -167,7 +166,6 @@ cdef class SectionFiniteFieldHomomorphism_generic(Section):
"""
return "Section of %s" % self._inverse


def _latex_(self):
r"""
Return a latex representation of this section.
Expand Down Expand Up @@ -321,7 +319,6 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
f = f.map_coefficients(bm)
return f(self.im_gens()[0])


def is_injective(self):
"""
Return ``True`` since a embedding between finite fields is
Expand All @@ -338,7 +335,6 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
"""
return True


def is_surjective(self):
"""
Return ``True`` if this embedding is surjective (and hence an
Expand All @@ -358,7 +354,6 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens):
"""
return self.domain().cardinality() == self.codomain().cardinality()


@cached_method
def section(self):
"""
Expand Down Expand Up @@ -544,7 +539,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
self._q = domain.characteristic() ** self._power
RingHomomorphism.__init__(self, Hom(domain, domain))


def _repr_(self):
"""
Return a string representation of this endomorphism.
Expand All @@ -568,7 +562,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
s += " %s" % self.domain()
return s


def _repr_short(self):
"""
Return a short string representation of this endomorphism.
Expand All @@ -591,7 +584,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
s = "%s |--> %s^(%s^%s)" % (name, name, self.domain().characteristic(), self._power)
return s


def _latex_(self):
r"""
Return a latex representation of this endomorphism.
Expand All @@ -615,7 +607,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
s = "%s \\mapsto %s^{%s^{%s}}" % (name, name, self.domain().characteristic(), self._power)
return s


cpdef Element _call_(self, x):
"""
TESTS::
Expand All @@ -632,7 +623,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
else:
return x.pth_power(self._power)


def order(self):
"""
Return the order of this endomorphism.
Expand Down Expand Up @@ -673,7 +663,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
"""
return self._power


def __pow__(self, n, modulus):
"""
Return the `n`-th iterate of this endomorphism.
Expand Down Expand Up @@ -735,7 +724,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
else:
return RingHomomorphism._composition(self, right)


def fixed_field(self):
"""
Return the fixed field of ``self``.
Expand Down Expand Up @@ -780,7 +768,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
f = FiniteFieldHomomorphism_generic(Hom(k, self.domain()))
return k, f


def is_injective(self):
"""
Return ``True`` since any power of the Frobenius endomorphism
Expand All @@ -795,7 +782,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
"""
return True


def is_surjective(self):
"""
Return ``True`` since any power of the Frobenius endomorphism
Expand All @@ -810,7 +796,6 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic):
"""
return True


def is_identity(self):
"""
Return ``True`` if this morphism is the identity morphism.
Expand Down
16 changes: 4 additions & 12 deletions src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
"""
fmpz_poly_init(self._poly)


def __dealloc__(self):
r"""
Call the underlying FLINT fmpz_poly destructor
Expand Down Expand Up @@ -652,7 +651,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
sig_off()
return x


cpdef _sub_(self, right):
r"""
Return ``self`` minus ``right``.
Expand All @@ -672,7 +670,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
sig_off()
return x


cpdef _neg_(self):
r"""
Return negative of ``self``.
Expand Down Expand Up @@ -834,7 +831,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
sig_off()
return x


@coerce_binop
def lcm(self, right):
"""
Expand Down Expand Up @@ -955,7 +951,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
else:
return self._parent(rr), ss, tt


cpdef _mul_(self, right):
r"""
Return ``self`` multiplied by ``right``.
Expand Down Expand Up @@ -1360,11 +1355,10 @@ cdef class Polynomial_integer_dense_flint(Polynomial):

return real_roots(self)

## def __copy__(self):
## f = Polynomial_integer_dense(self.parent())
## f._poly = self._poly.copy()
## return f

# def __copy__(self):
# f = Polynomial_integer_dense(self.parent())
# f._poly = self._poly.copy()
# return f

def degree(self, gen=None):
"""
Expand Down Expand Up @@ -1485,7 +1479,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
variable = self.parent().variable_name()
return pari(self.list()).Polrev(variable)


def squarefree_decomposition(Polynomial_integer_dense_flint self):
"""
Return the square-free decomposition of ``self``. This is
Expand Down Expand Up @@ -1743,7 +1736,6 @@ cdef class Polynomial_integer_dense_flint(Polynomial):
"""
return [self.get_unsafe(i) for i in range(self.degree()+1)]


@coerce_binop
def resultant(self, other, proof=True):
"""
Expand Down
Loading

0 comments on commit 488b258

Please sign in to comment.