Skip to content

Commit 2b58d81

Browse files
author
Release Manager
committed
gh-39566: some fixes for E272 in pyx files namely `E272 multiple spaces before keyword` ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #39566 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents 1fd48ed + 7be6aa1 commit 2b58d81

File tree

17 files changed

+76
-74
lines changed

17 files changed

+76
-74
lines changed

src/sage/coding/codecan/codecan.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ cdef class PartitionRefinementLinearCode(PartitionRefinement_generic):
636636
else:
637637
P = remaining_inner_group.column_blocks(self._best_candidate)
638638
for p in P:
639-
x = S(v=[ F.primitive_element() if i in p else F.one() for i in range(self._n) ])
639+
x = S(v=[F.primitive_element() if i in p else F.one()
640+
for i in range(self._n)])
640641
self._autom_group_generators.append(transp_inv * x * self._transporter)
641642
self._inner_group_stabilizer_order = (len(F) - 1) ** len(P)
642643

src/sage/combinat/designs/designs_pyx.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,12 +948,12 @@ cpdef _OA_cache_set(int k, int n, truth_value):
948948
_OA_cache_size = new_cache_size
949949

950950
if truth_value is True:
951-
_OA_cache[n].max_true = k if k>_OA_cache[n].max_true else _OA_cache[n].max_true
951+
_OA_cache[n].max_true = k if k>_OA_cache[n].max_true else _OA_cache[n].max_true
952952
elif truth_value is Unknown:
953953
_OA_cache[n].min_unknown = k if k<_OA_cache[n].min_unknown else _OA_cache[n].min_unknown
954954
_OA_cache[n].max_unknown = k if k>_OA_cache[n].max_unknown else _OA_cache[n].max_unknown
955955
else:
956-
_OA_cache[n].min_false = k if k<_OA_cache[n].min_false else _OA_cache[n].min_false
956+
_OA_cache[n].min_false = k if k<_OA_cache[n].min_false else _OA_cache[n].min_false
957957

958958
cpdef _OA_cache_get(int k, int n):
959959
r"""

src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ cpdef find_construction_3_5(int k, int n):
391391
for s in range(min(i+1,nn)):
392392
for r in range(max(0,i-nn-s), min(s+1,i-s+1,nn)):
393393
t = i - r - s
394-
if ((nn-r-1)*(nn-s) < t and
395-
(r==0 or is_available(k,r)) and
396-
(s==0 or is_available(k,s)) and
397-
(t==0 or is_available(k,t))):
394+
if ((nn-r-1)*(nn-s) < t and
395+
(r==0 or is_available(k, r)) and
396+
(s==0 or is_available(k, s)) and
397+
(t==0 or is_available(k, t))):
398398
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_3_5
399399
return construction_3_5, (k,nn,mm,r,s,t)
400400

@@ -481,15 +481,15 @@ cpdef find_q_x(int k, int n):
481481
x = (n-q**2+q-2)/(2-q)
482482
if (x < q and
483483
0 < x and
484-
n == (q-1)*(q-x)+x+2 and
485-
is_available(k+1,q-x-1) and
486-
is_available(k+1,q-x+1) and
484+
n == (q-1)*(q-x)+x+2 and
485+
is_available(k+1, q-x-1) and
486+
is_available(k+1, q-x+1) and
487487
# The next is always True, because q is a prime power
488488
# is_available(k+1,q) and
489-
is_available(k, x+2 ) and
489+
is_available(k, x+2 ) and
490490
smallInteger(q).is_prime_power()):
491491
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_q_x
492-
return construction_q_x, (k,q,x)
492+
return construction_q_x, (k, q, x)
493493
return False
494494

495495
cpdef find_thwart_lemma_3_5(int k, int N):
@@ -865,11 +865,11 @@ def int_as_sum(int value, list S, int k_max):
865865
vv = v-i
866866
if vv == 0:
867867
return D[v] + (i,)
868-
if (vv > 0 and # The new integer i is too big
868+
if (vv > 0 and # The new integer i is too big
869869
vv <= j*max_value and # The new integer i is too small
870-
vv not in D and # We had it in D already
870+
vv not in D and # We had it in D already
871871
vv not in new_D): # We had it in new_D already
872-
new_D[vv] = D[v]+(i,)
872+
new_D[vv] = D[v] + (i,)
873873
if not new_D:
874874
break
875875
D.update(new_D)

src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ import numbers
8686
from memory_allocator cimport MemoryAllocator
8787
from cysignals.memory cimport check_calloc, sig_free
8888

89-
from sage.graphs.graph import Graph
90-
from sage.geometry.polyhedron.base import Polyhedron_base
89+
from sage.graphs.graph import Graph
90+
from sage.geometry.polyhedron.base import Polyhedron_base
9191
from sage.geometry.lattice_polytope import LatticePolytopeClass
92-
from sage.geometry.cone import ConvexRationalPolyhedralCone
93-
from sage.structure.element import Matrix
94-
from sage.matrix.matrix_dense cimport Matrix_dense
95-
from sage.misc.misc import is_iterator
92+
from sage.geometry.cone import ConvexRationalPolyhedralCone
93+
from sage.structure.element import Matrix
94+
from sage.matrix.matrix_dense cimport Matrix_dense
95+
from sage.misc.misc import is_iterator
9696
from .conversions import (incidence_matrix_to_bit_rep_of_facets,
9797
incidence_matrix_to_bit_rep_of_Vrep,
9898
facets_tuple_to_bit_rep_of_facets,
9999
facets_tuple_to_bit_rep_of_Vrep)
100100
from sage.geometry.polyhedron.combinatorial_polyhedron.conversions cimport Vrep_list_to_bit_rep
101-
from sage.misc.cachefunc import cached_method
101+
from sage.misc.cachefunc import cached_method
102102

103-
from sage.rings.integer cimport smallInteger
104-
from cysignals.signals cimport sig_check
103+
from sage.rings.integer cimport smallInteger
104+
from cysignals.signals cimport sig_check
105105

106106
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_len_atoms, face_init, face_free
107107
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator cimport iter_t, parallel_f_vector

src/sage/graphs/graph_decompositions/slice_decomposition.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,10 @@ cdef class SliceDecomposition(SageObject):
414414

415415
# Translate the results with the actual vertices of the graph
416416
self.sigma = tuple(Gbackend.vertex_label(v_int) for v_int in sigma)
417-
self.sigma_inv = {v: i for i, v in enumerate(self.sigma)}
418-
self.lex_label = {i: tuple(Gbackend.vertex_label(v_int) for v_int in lli)
419-
for i, lli in enumerate(lex_label)}
417+
self.sigma_inv = {v: i for i, v in enumerate(self.sigma)}
418+
self.lex_label = {i: tuple(Gbackend.vertex_label(v_int)
419+
for v_int in lli)
420+
for i, lli in enumerate(lex_label)}
420421

421422
def __eq__(self, other):
422423
"""

src/sage/graphs/strongly_regular_db.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,11 +3295,11 @@ def _check_database():
32953295
if _brouwer_database[params]['status'] != "impossible":
32963296
raise RuntimeError("Brouwer's db does not seem to know that {} in unfeasible".format(params))
32973297
comment = _brouwer_database[params]['comments']
3298-
if ('Krein' in comment or
3298+
if ('Krein' in comment or
32993299
'Absolute' in comment or
3300-
'Conf' in comment or
3301-
'mu=1' in comment or
3302-
'&mu;=2' in comment):
3300+
'Conf' in comment or
3301+
'mu=1' in comment or
3302+
'&mu;=2' in comment):
33033303
continue
33043304
raise RuntimeError("We detected that {} was unfeasible, but maybe we should not have".format(params))
33053305

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ cdef aut_gp_and_can_lab *allocate_agcl_output(int n) noexcept:
308308
output.relabeling = <int *> sig_malloc(n*sizeof(int))
309309
output.generators = <int *> sig_malloc(2*n*n*sizeof(int))
310310
output.size_of_generator_array = 2*n*n
311-
if output.group is NULL or \
311+
if output.group is NULL or \
312312
output.relabeling is NULL or \
313313
output.generators is NULL:
314314
deallocate_agcl_output(output)

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,17 +617,17 @@ cdef StabilizerChain *SC_new(int n, bint init_gens=True) noexcept:
617617
SC.OP_scratch = OP_new(n)
618618
# bitset_init without the MemoryError:
619619
cdef long limbs = (default_num_bits - 1)/(8*sizeof(unsigned long)) + 1
620-
SC.gen_used.size = default_num_bits
621-
SC.gen_is_id.size = default_num_bits
622-
SC.gen_used.limbs = limbs
620+
SC.gen_used.size = default_num_bits
621+
SC.gen_is_id.size = default_num_bits
622+
SC.gen_used.limbs = limbs
623623
SC.gen_is_id.limbs = limbs
624-
SC.gen_used.bits = <mp_limb_t*>sig_malloc(limbs * sizeof(mp_limb_t))
625-
SC.gen_is_id.bits = <mp_limb_t*>sig_malloc(limbs * sizeof(mp_limb_t))
624+
SC.gen_used.bits = <mp_limb_t*>sig_malloc(limbs * sizeof(mp_limb_t))
625+
SC.gen_is_id.bits = <mp_limb_t*>sig_malloc(limbs * sizeof(mp_limb_t))
626626

627627
# check for allocation failures
628-
if int_array is NULL or int_ptrs is NULL or \
628+
if int_array is NULL or int_ptrs is NULL or \
629629
SC.gen_used.bits is NULL or SC.gen_is_id.bits is NULL or \
630-
SC.OP_scratch is NULL:
630+
SC.OP_scratch is NULL:
631631
sig_free(int_array)
632632
sig_free(int_ptrs)
633633
SC_dealloc(SC)

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,24 +213,24 @@ cdef dc_work_space *allocate_dc_work_space(int n) noexcept:
213213
return NULL
214214

215215
work_space.degree = n
216-
int_array = <int *> sig_malloc((n*n + # for perm_stack
216+
int_array = <int *> sig_malloc((n*n + # for perm_stack
217217
5*n # for int_array
218218
)*sizeof(int))
219219
work_space.group1 = SC_new(n)
220220
work_space.group2 = SC_new(n)
221-
work_space.current_ps = PS_new(n,0)
222-
work_space.first_ps = PS_new(n,0)
221+
work_space.current_ps = PS_new(n, 0)
222+
work_space.first_ps = PS_new(n, 0)
223223
work_space.bitset_array = <bitset_t *> sig_calloc((n + 2*len_of_fp_and_mcr + 1), sizeof(bitset_t))
224224
work_space.orbits_of_subgroup = OP_new(n)
225225
work_space.perm_stack = NULL
226226

227-
if int_array is NULL or \
228-
work_space.group1 is NULL or \
229-
work_space.group2 is NULL or \
230-
work_space.current_ps is NULL or \
231-
work_space.first_ps is NULL or \
232-
work_space.bitset_array is NULL or \
233-
work_space.orbits_of_subgroup is NULL:
227+
if int_array is NULL or \
228+
work_space.group1 is NULL or \
229+
work_space.group2 is NULL or \
230+
work_space.current_ps is NULL or \
231+
work_space.first_ps is NULL or \
232+
work_space.bitset_array is NULL or \
233+
work_space.orbits_of_subgroup is NULL:
234234
sig_free(int_array)
235235
deallocate_dc_work_space(work_space)
236236
return NULL

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,8 @@ cdef int allocate_subset_gen_2(int degree, int max_size, iterator *it) noexcept:
643643
cgd.iterator_stack[i].data = allocate_sgd(degree)
644644
cgd.iterator_stack[i].next = &subset_generator_next
645645
if cgd.iterator_stack[i].data is NULL or \
646-
cgd.object_stack[i] is NULL or \
647-
cgd.parent_stack[i] is NULL:
646+
cgd.object_stack[i] is NULL or \
647+
cgd.parent_stack[i] is NULL:
648648
for j from 0 <= j <= i:
649649
deallocate_sgd(cgd.iterator_stack[i].data)
650650
free_subset(cgd.object_stack[i])

0 commit comments

Comments
 (0)