Skip to content

Commit 8a49d3b

Browse files
author
Release Manager
committed
gh-35553: cython-lint cleaning in combinat/ <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description Some fixes about unused imports and variables in pyx files inside `combinat` found using ``` cython-lint --ignore=E,W src/sage/combinat/ ``` <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [x] 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 accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35553 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
2 parents 57bd5b8 + b574330 commit 8a49d3b

16 files changed

+27
-47
lines changed

src/sage/combinat/crystals/pbw_datum.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ AUTHORS:
2525
#from sage.misc.lazy_attribute import lazy_attribute
2626
from sage.misc.cachefunc import cached_method
2727
from sage.combinat.root_system.cartan_type import CartanType
28-
from sage.combinat.root_system.coxeter_group import CoxeterGroup
2928
from sage.combinat.root_system.root_system import RootSystem
3029
from sage.combinat.root_system.braid_move_calculator import BraidMoveCalculator
3130

@@ -450,7 +449,7 @@ cpdef list enhance_braid_move_chain(braid_move_chain, cartan_type):
450449
"""
451450
cdef int i, j
452451
cdef int k, pos, first, last
453-
cdef tuple interval_of_change, cartan_sub_matrix
452+
cdef tuple cartan_sub_matrix
454453
cdef list output_list = []
455454
output_list.append( (None, None) )
456455
cdef tuple previous_word = <tuple> (braid_move_chain[0])

src/sage/combinat/crystals/spins.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ representing the elements of the spin crystal by sequences of signs
4444

4545
from cpython.object cimport Py_EQ, Py_NE, Py_LE, Py_GE, Py_LT, Py_GT
4646
from cysignals.memory cimport sig_malloc, sig_free
47-
from sage.misc.cachefunc import cached_method
4847
from sage.misc.lazy_attribute import lazy_attribute
4948
from sage.structure.unique_representation import UniqueRepresentation
5049
from sage.structure.parent cimport Parent

src/sage/combinat/crystals/tensor_product_element.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ AUTHORS:
3030
# https://www.gnu.org/licenses/
3131
#****************************************************************************
3232

33-
from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE
3433
from sage.structure.parent cimport Parent
3534

3635
from sage.misc.cachefunc import cached_method, cached_in_parent_method
@@ -1642,7 +1641,7 @@ cdef class TensorProductOfQueerSuperCrystalsElement(TensorProductOfRegularCrysta
16421641

16431642

16441643
cdef class InfinityQueerCrystalOfTableauxElement(TensorProductOfQueerSuperCrystalsElement):
1645-
def __init__(self, parent, list, row_lengths=[]):
1644+
def __init__(self, parent, list, row_lengths=None):
16461645
"""
16471646
Initialize ``self``.
16481647
@@ -1654,6 +1653,8 @@ cdef class InfinityQueerCrystalOfTableauxElement(TensorProductOfQueerSuperCrysta
16541653
[[4, 4, 4, 4, 2, 1], [3, 3, 3], [2, 2], [1]]
16551654
sage: TestSuite(t).run()
16561655
"""
1656+
if row_lengths is None:
1657+
row_lengths = []
16571658
if not row_lengths and list and not isinstance(list[0], parent.letters.element_class):
16581659
ret = []
16591660
L = parent.letters

src/sage/combinat/degree_sequences.pyx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,23 +264,19 @@ Checking the consistency of enumeration and test::
264264
than a couple of minutes.
265265
"""
266266

267-
#*****************************************************************************
267+
# ****************************************************************************
268268
# Copyright (C) 2011 Nathann Cohen <[email protected]>
269269
#
270270
# This program is free software: you can redistribute it and/or modify
271271
# it under the terms of the GNU General Public License as published by
272272
# the Free Software Foundation, either version 2 of the License, or
273273
# (at your option) any later version.
274-
# http://www.gnu.org/licenses/
275-
#*****************************************************************************
274+
# https://www.gnu.org/licenses/
275+
# ****************************************************************************
276276

277-
278-
from libc.string cimport memset
279277
from cysignals.memory cimport check_calloc, sig_free
280278
from cysignals.signals cimport sig_on, sig_off
281279

282-
from sage.rings.integer cimport Integer
283-
284280

285281
cdef unsigned char * seq
286282
cdef list sequences

src/sage/combinat/designs/designs_pyx.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def is_group_divisible_design(groups,blocks,v,G=None,K=None,lambd=1,verbose=Fals
224224
(True, [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12]])
225225
"""
226226
cdef int n = v
227-
cdef int i,ii,j,jj,s,isok
227+
cdef int i,ii,j,jj,s
228228
cdef int l = lambd
229229
cdef bint guess_groups = groups is None
230230

src/sage/combinat/designs/evenly_distributed_sets.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from libc.string cimport memset, memcpy
2323

2424
from cysignals.memory cimport check_malloc, check_calloc, sig_free
2525

26-
from sage.rings.integer cimport Integer,smallInteger
26+
from sage.rings.integer cimport smallInteger
2727

2828
cdef class EvenlyDistributedSetsBacktracker:
2929
r"""
@@ -212,7 +212,7 @@ cdef class EvenlyDistributedSetsBacktracker:
212212
self.up_to_isom = bool(up_to_isomorphism)
213213
self.count = 0
214214

215-
cdef unsigned int i,j,ell
215+
cdef unsigned int i,j
216216

217217
if not K.is_field():
218218
raise ValueError("{} is not a field".format(K))

src/sage/combinat/designs/gen_quadrangles_with_spread.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,6 @@ def generalised_quadrangle_hermitian_with_ovoid(const int q):
286286
from sage.arith.misc import is_prime_power
287287

288288
GU = libgap.GU(4, q)
289-
H = libgap.InvariantSesquilinearForm(GU)["matrix"]
290289
Fq = libgap.GF(q * q)
291290
zero = libgap.Zero(Fq)
292291
one = libgap.One(Fq)
@@ -310,14 +309,13 @@ def generalised_quadrangle_hermitian_with_ovoid(const int q):
310309
lines = [list(map(lambda x: int(x - 1), b)) for b in lines] # convert to int
311310
# lines defines the GQ H(3, q^2)
312311

313-
314312
# to find an ovoid, we embed H(3,q^2) in H(4,q^2)
315313
# the embedding is (a,b,c,d) -> (a,b,0,c,d)
316314
# then we find a point in the latter and not in the former
317315
# this point will be collinear (in H(3,q^2)) to all points in an ovoid
318316
if q % 2 == 1:
319-
(p, k) = is_prime_power(q, get_data=True)
320-
a = (p-1) // 2
317+
p, _ = is_prime_power(q, get_data=True)
318+
a = (p - 1) // 2
321319
aGap = zero
322320
for i in range(a):
323321
aGap += one

src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Functions
4747

4848
from sage.misc.cachefunc import cached_function
4949
from .orthogonal_arrays import orthogonal_array
50-
from sage.rings.integer cimport Integer, smallInteger
50+
from sage.rings.integer cimport smallInteger
5151
from sage.arith.misc import prime_powers
5252

5353
@cached_function

src/sage/combinat/designs/subhypergraph_search.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Methods
119119

120120
from libc.stdlib cimport qsort
121121
from libc.stdint cimport uint64_t
122-
from cysignals.memory cimport sig_malloc, sig_calloc, sig_realloc, sig_free
122+
from cysignals.memory cimport sig_malloc, sig_calloc, sig_free
123123

124124
ctypedef struct hypergraph:
125125
int n
@@ -490,7 +490,6 @@ cdef class SubHypergraphSearch:
490490
cdef hypergraph h1 = self.h1
491491
cdef hypergraph h2 = self.h2
492492
cdef hypergraph tmp1 = self.tmp1
493-
cdef hypergraph tmp2 = self.tmp2
494493
cdef int * step = self.step
495494

496495
if h1.n<h2.n or h1.m<h2.m:

src/sage/combinat/enumeration_mod_permgroup.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ cpdef set orbit(list sgs, ClonableIntArray v):
274274
cdef set to_analyse, new_to_analyse
275275
cdef ClonableIntArray list_test, child
276276
cdef PermutationGroupElement x
277-
cdef list out
278277
l = len(v)
279278
to_analyse = set([v])
280279
for i in range(l-1):

0 commit comments

Comments
 (0)