Skip to content

Commit e8c77d8

Browse files
author
Release Manager
committed
gh-36963: some care for pep8 code E241 in some pyx files just fixing a few cases of pep8 E241 (spaces before commas) in some pyx files ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36963 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents 974cf61 + 00484bc commit e8c77d8

File tree

19 files changed

+118
-120
lines changed

19 files changed

+118
-120
lines changed

src/sage/coding/codecan/codecan.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,8 @@ cdef class PartitionRefinementLinearCode(PartitionRefinement_generic):
920920
if self._inner_group.rank < 2:
921921
return True
922922
923-
lower = iter(self._matrix[ : self._inner_group.rank ].columns())
924-
upper = iter(self._matrix[ self._inner_group.rank : ].columns())
923+
lower = iter(self._matrix[ : self._inner_group.rank].columns())
924+
upper = iter(self._matrix[self._inner_group.rank : ].columns())
925925
926926
for i in range(self._n):
927927
l = next(lower)

src/sage/combinat/crystals/tensor_product_element.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,4 +1867,4 @@ cdef Py_ssize_t count_leading(list row, letter) noexcept:
18671867

18681868
# for unpickling
18691869
from sage.misc.persist import register_unpickle_override
1870-
register_unpickle_override('sage.combinat.crystals.tensor_product', 'ImmutableListWithParent', ImmutableListWithParent)
1870+
register_unpickle_override('sage.combinat.crystals.tensor_product', 'ImmutableListWithParent', ImmutableListWithParent)

src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -732,69 +732,68 @@ cpdef find_brouwer_separable_design(int k,int n) noexcept:
732732
False
733733
"""
734734
from sage.combinat.designs.orthogonal_arrays_build_recursive import brouwer_separable_design
735-
cdef int q,x,baer_subplane_size, max_t, min_t, t,e1,e2,e3,e4
735+
cdef int q, x, baer_subplane_size, max_t, min_t, t, e1, e2, e3, e4
736736

737-
for q in prime_powers(2,n):
738-
baer_subplane_size = q**2+q+1
737+
for q in prime_powers(2, n):
738+
baer_subplane_size = q**2 + q + 1
739739
if baer_subplane_size > n:
740740
break
741741
# x <= q^2+1
742742
# <=> n-t(q^2+q+1) <= q^2+1
743743
# <=> n-q^2-1 <= t(q^2+q+1)
744744
# <=> (n-q^2-1)/(q^2+q+1) <= t
745745

746-
min_t = (n-q**2-1)/baer_subplane_size
747-
max_t = min(n/baer_subplane_size,q**2-q+1)
746+
min_t = (n - q**2 - 1) / baer_subplane_size
747+
max_t = min(n / baer_subplane_size, q**2 - q + 1)
748748

749-
for t in range(min_t,max_t+1):
750-
x = n - t*baer_subplane_size
751-
e1 = int(x != q**2-q-t)
749+
for t in range(min_t, max_t + 1):
750+
x = n - t * baer_subplane_size
751+
e1 = int(x != q**2 - q - t)
752752
e2 = int(x != 1)
753753
e3 = int(x != q**2)
754-
e4 = int(x != t+q+1)
754+
e4 = int(x != t + q + 1)
755755

756756
# i)
757757
if (x == 0 and
758-
is_available(k, t) and
759-
is_available(k,t+q)):
760-
return brouwer_separable_design, (k,t,q,x)
758+
is_available(k, t) and is_available(k, t + q)):
759+
return brouwer_separable_design, (k, t, q, x)
761760

762761
# ii)
763-
elif (x == t+q and
764-
is_available(k+e3, t ) and
765-
is_available( k , t+q ) and
766-
is_available(k+1 ,t+q+1)):
767-
return brouwer_separable_design, (k,t,q,x)
762+
elif (x == t + q and
763+
is_available(k + e3, t) and
764+
is_available(k, t + q) and
765+
is_available(k + 1, t + q + 1)):
766+
return brouwer_separable_design, (k, t, q, x)
768767

769768
# iii)
770-
elif (x == q**2-q+1-t and
771-
is_available( k , x ) and
772-
is_available( k+e2, t+1 ) and
773-
is_available( k+1 , t+q )):
774-
return brouwer_separable_design, (k,t,q,x)
769+
elif (x == q**2 - q + 1 - t and
770+
is_available(k, x) and
771+
is_available(k + e2, t + 1)
772+
and is_available(k + 1, t + q)):
773+
return brouwer_separable_design, (k, t, q, x)
775774

776775
# iv)
777-
elif (x == q**2+1 and
778-
is_available( k , x ) and
779-
is_available( k+e4, t+1 ) and
780-
is_available( k+1 ,t+q+1)):
781-
return brouwer_separable_design, (k,t,q,x)
776+
elif (x == q**2 + 1 and
777+
is_available(k, x) and
778+
is_available(k + e4, t + 1) and
779+
is_available(k + 1, t + q + 1)):
780+
return brouwer_separable_design, (k, t, q, x)
782781

783782
# v)
784-
elif (0<x and x<q**2-q+1-t and (e1 or e2) and
785-
is_available( k , x ) and
786-
is_available( k+e1, t ) and
787-
is_available( k+e2, t+1 ) and
788-
is_available( k+1 , t+q )):
789-
return brouwer_separable_design, (k,t,q,x)
783+
elif (0 < x < q**2 - q + 1 - t and (e1 or e2) and
784+
is_available(k, x) and
785+
is_available(k + e1, t) and
786+
is_available(k + e2, t + 1) and
787+
is_available(k + 1, t + q)):
788+
return brouwer_separable_design, (k, t, q, x)
790789

791790
# vi)
792-
elif (t+q<x and x<q**2+1 and (e3 or e4) and
793-
is_available( k , x ) and
794-
is_available( k+e3, t ) and
795-
is_available( k+e4, t+1 ) and
796-
is_available( k+1 ,t+q+1)):
797-
return brouwer_separable_design, (k,t,q,x)
791+
elif (t + q < x < q**2 + 1 and (e3 or e4) and
792+
is_available(k, x) and
793+
is_available(k + e3, t) and
794+
is_available(k + e4, t + 1) and
795+
is_available(k + 1, t + q + 1)):
796+
return brouwer_separable_design, (k, t, q, x)
798797

799798
return False
800799

@@ -804,11 +803,11 @@ from sage.combinat.designs.database import QDM as __QDM
804803
cdef dict _QDM = __QDM
805804
cdef dict ioa_indexed_by_n_minus_x = {}
806805
for x in _QDM.itervalues():
807-
for (n,_,_,u),(k,_) in x.items():
808-
if u>1:
806+
for (n, _, _, u), (k, _) in x.items():
807+
if u > 1:
809808
if n not in ioa_indexed_by_n_minus_x:
810809
ioa_indexed_by_n_minus_x[n] = []
811-
ioa_indexed_by_n_minus_x[n].append((k,u))
810+
ioa_indexed_by_n_minus_x[n].append((k, u))
812811

813812

814813
def int_as_sum(int value, list S, int k_max):

src/sage/groups/perm_gps/partn_ref/data_structures.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,12 +629,12 @@ cdef inline int SC_realloc_gens(StabilizerChain *SC, int level, int size) noexce
629629
cdef int *temp
630630
cdef int n = SC.degree
631631

632-
temp = <int *> sig_realloc( SC.generators[level], n * size * sizeof(int) )
632+
temp = <int *> sig_realloc(SC.generators[level], n * size * sizeof(int))
633633
if temp is NULL:
634634
return 1
635635
SC.generators[level] = temp
636636

637-
temp = <int *> sig_realloc( SC.gen_inverses[level], n * size * sizeof(int) )
637+
temp = <int *> sig_realloc(SC.gen_inverses[level], n * size * sizeof(int))
638638
if temp is NULL:
639639
return 1
640640
SC.gen_inverses[level] = temp

src/sage/groups/perm_gps/partn_ref/double_coset.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,14 @@ cdef int double_coset(void *S1, void *S2, PartitionStack *partition1, int *order
400400
cdef bint unknown = 1
401401

402402
# set up the identity permutation
403-
for i from 0 <= i < n:
403+
for i in range(n):
404404
id_perm[i] = i
405405
if ordering2 is NULL:
406406
ordering2 = id_perm
407407

408408
# Copy reordering of left_ps coming from ordering2 to current_ps.
409-
memcpy(current_ps.entries, ordering2, n*sizeof(int))
410-
memcpy(current_ps.levels, left_ps.levels, n*sizeof(int))
409+
memcpy(current_ps.entries, ordering2, n * sizeof(int))
410+
memcpy(current_ps.levels, left_ps.levels, n * sizeof(int))
411411
current_ps.depth = left_ps.depth
412412

413413
# default values of "infinity"

src/sage/matrix/action.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,10 @@ cdef class MatrixMatrixAction(MatrixMulAction):
195195
Nonetheless, there is no guarantee that the set that is acted upon
196196
will always be cached in such a way, so that following the above
197197
example is good practice.
198-
199198
"""
200199
if self.G.ncols() != self.underlying_set().nrows():
201200
raise TypeError("incompatible dimensions %s, %s" %
202-
(self.G.ncols(), self.underlying_set().nrows()))
201+
(self.G.ncols(), self.underlying_set().nrows()))
203202
return MatrixSpace(base, self.G.nrows(), self.underlying_set().ncols(),
204203
sparse = self.G.is_sparse() and self.underlying_set().is_sparse())
205204

0 commit comments

Comments
 (0)