Skip to content

Commit 1d51c7d

Browse files
author
Release Manager
committed
Trac #34323: fix E251 in groups
about {{{ E251 unexpected spaces around keyword / parameter equals }}} URL: https://trac.sagemath.org/34323 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): David Coudert
2 parents ce36eba + 7dfb048 commit 1d51c7d

11 files changed

+32
-29
lines changed

src/sage/groups/additive_abelian/additive_abelian_group.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from sage.modules.fg_pid.fgp_element import FGP_Element
1212
from sage.rings.integer_ring import ZZ
1313

14-
def AdditiveAbelianGroup(invs, remember_generators = True):
14+
15+
def AdditiveAbelianGroup(invs, remember_generators=True):
1516
r"""
1617
Construct a finitely-generated additive abelian group.
1718

src/sage/groups/additive_abelian/additive_abelian_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def _element_constructor_(self, x, check=False):
465465
(6, 2)
466466
"""
467467
if parent(x) is self.universe():
468-
return self.element_class(self, self.discrete_log(x), element = x)
468+
return self.element_class(self, self.discrete_log(x), element=x)
469469
return addgp.AdditiveAbelianGroup_fixed_gens._element_constructor_(self, x, check)
470470

471471

src/sage/groups/cubic_braid.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,10 @@ def AssionGroupU(n=None, names='u'):
218218
Assion group on 3 strands of type U
219219
sage: U3 == U3x
220220
True
221-
222221
"""
223222
return CubicBraidGroup(n=n, names=names, cbg_type=CubicBraidGroup.type.AssionU)
224223

225224

226-
227225
##############################################################################
228226
#
229227
# Class CubicBraidElement (for elements)
@@ -354,9 +352,9 @@ def braid(self):
354352
braid_group = self.parent().braid_group()
355353
return braid_group(self)
356354

357-
358355
@cached_method
359-
def burau_matrix(self, root_bur = None, domain = None, characteristic = None, var='t', reduced=False):
356+
def burau_matrix(self, root_bur=None, domain=None, characteristic=None,
357+
var='t', reduced=False):
360358
r"""
361359
Return the Burau matrix of the cubic braid coset.
362360
@@ -1994,9 +1992,9 @@ def is_finite(self):
19941992
"""
19951993
return not (self._cbg_type == CubicBraidGroup.type.Coxeter and self.strands() > 5)
19961994

1997-
# ----------------------------------------------------------------------------------
1995+
# ------------------------------------------------------------------
19981996
# creating a CubicBraidGroup as subgroup of self on less strands
1999-
# ----------------------------------------------------------------------------------
1997+
# ------------------------------------------------------------------
20001998
def cubic_braid_subgroup(self, nstrands=None):
20011999
r"""
20022000
Return a cubic braid group as subgroup of ``self`` on the first

src/sage/groups/finitely_presented.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ def epimorphisms(self, H):
14861486
res.append(fhom)
14871487
return res
14881488

1489-
def alexander_matrix(self, im_gens = None):
1489+
def alexander_matrix(self, im_gens=None):
14901490
"""
14911491
Return the Alexander matrix of the group.
14921492

src/sage/groups/old.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cdef class Group(sage.structure.parent.Parent):
3131
"""
3232
Generic group class
3333
"""
34-
def __init__(self, category = None):
34+
def __init__(self, category=None):
3535
"""
3636
3737
TESTS::

src/sage/groups/perm_gps/cubegroup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def repr2d(self, mv):
944944
line13 = " +--------------+\n"
945945
return line1+line2+line3+line4+line5+line6+line7+line8+line9+line10+line11+line12+line13
946946

947-
def plot_cube(self, mv, title=True, colors = [lpurple, yellow, red, green, orange, blue]):
947+
def plot_cube(self, mv, title=True, colors=[lpurple, yellow, red, green, orange, blue]):
948948
r"""
949949
Input the move mv, as a string in the Singmaster notation, and
950950
output the 2D plot of the cube in that state.

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -1257,8 +1257,9 @@ cdef void free_dg_edge_gen(iterator *dg_edge_gen):
12571257
sig_free(dg_edge_gen)
12581258

12591259

1260-
def generate_dense_graphs_edge_addition(int n, bint loops, G = None, depth = None, bint construct = False,
1261-
bint indicate_mem_err = True):
1260+
def generate_dense_graphs_edge_addition(int n, bint loops, G=None, depth=None,
1261+
bint construct=False,
1262+
bint indicate_mem_err=True):
12621263
r"""
12631264
12641265
EXAMPLES::
@@ -1534,7 +1535,10 @@ cdef void free_cgd_2(void *data):
15341535
cdef canonical_generator_data *cgd = <canonical_generator_data *> data
15351536
deallocate_cgd(cgd)
15361537

1537-
def generate_dense_graphs_vert_addition(int n, base_G = None, bint construct = False, bint indicate_mem_err = True):
1538+
1539+
def generate_dense_graphs_vert_addition(int n, base_G=None,
1540+
bint construct=False,
1541+
bint indicate_mem_err=True):
15381542
r"""
15391543
15401544
EXAMPLES::

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,9 @@ cdef iterator *setup_set_gen(iterator *subset_gen, int degree, int max_size):
685685
bitset_clear(&empty_set.bits)
686686
return subset_iterator
687687

688-
def sets_modulo_perm_group(list generators, int max_size, bint indicate_mem_err = 1):
688+
689+
def sets_modulo_perm_group(list generators, int max_size,
690+
bint indicate_mem_err=1):
689691
r"""
690692
Given generators of a permutation group, list subsets up to permutations in
691693
the group.

src/sage/groups/perm_gps/partn_ref2/refinement_generic.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ cdef class PartitionRefinement_generic:
639639
self._backtrack(True)
640640
self._finish_latex()
641641

642-
cdef void _backtrack(self, bint first_step = False):
642+
cdef void _backtrack(self, bint first_step=False):
643643
r"""
644644
Backtracking with pruning.
645645

src/sage/groups/perm_gps/permgroup.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,7 @@ def semidirect_product(self, N, mapping, check=True):
27952795
from sage.categories.finite_permutation_groups import FinitePermutationGroups
27962796
if N not in FinitePermutationGroups():
27972797
raise TypeError("{0} is not a permutation group".format(N))
2798-
if not PermutationGroup(gens = mapping[0]) == self:
2798+
if not PermutationGroup(gens=mapping[0]) == self:
27992799
msg = 'the generator list must generate the calling group, {0} does not generate {1}'
28002800
raise ValueError(msg.format(mapping[0], self._repr_()))
28012801
if len(mapping[0]) != len(mapping[1]):
@@ -3173,7 +3173,7 @@ def commutator(self, other=None):
31733173
return PermutationGroup(gap_group=gap_group)
31743174

31753175
@hap_decorator
3176-
def cohomology(self, n, p = 0):
3176+
def cohomology(self, n, p=0):
31773177
r"""
31783178
Computes the group cohomology `H^n(G, F)`, where `F = \ZZ`
31793179
if `p=0` and `F = \ZZ / p \ZZ` if `p > 0` is a prime.
@@ -3222,7 +3222,7 @@ def cohomology(self, n, p = 0):
32223222
return AbelianGroup(len(L), L)
32233223

32243224
@hap_decorator
3225-
def cohomology_part(self, n, p = 0):
3225+
def cohomology_part(self, n, p=0):
32263226
r"""
32273227
Compute the p-part of the group cohomology `H^n(G, F)`,
32283228
where `F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if
@@ -3258,7 +3258,7 @@ def cohomology_part(self, n, p = 0):
32583258
return AbelianGroup(len(L), L)
32593259

32603260
@hap_decorator
3261-
def homology(self, n, p = 0):
3261+
def homology(self, n, p=0):
32623262
r"""
32633263
Computes the group homology `H_n(G, F)`, where
32643264
`F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if
@@ -3306,7 +3306,7 @@ def homology(self, n, p = 0):
33063306
return AbelianGroup(len(L), L)
33073307

33083308
@hap_decorator
3309-
def homology_part(self, n, p = 0):
3309+
def homology_part(self, n, p=0):
33103310
r"""
33113311
Computes the `p`-part of the group homology
33123312
`H_n(G, F)`, where `F = \ZZ` if `p=0` and
@@ -3630,7 +3630,7 @@ def _regular_subgroup_gap(self):
36303630
return C
36313631

36323632
@cached_method
3633-
def has_regular_subgroup(self, return_group = False):
3633+
def has_regular_subgroup(self, return_group=False):
36343634
r"""
36353635
Return whether the group contains a regular subgroup.
36363636
@@ -3670,12 +3670,10 @@ def has_regular_subgroup(self, return_group = False):
36703670
b = (C is not None)
36713671
if b and return_group:
36723672
G = self.subgroup(gap_group=C.Representative())
3673-
if return_group:
3674-
return G
3675-
else:
3676-
return b
36773673

3678-
def blocks_all(self, representatives = True):
3674+
return G if return_group else b
3675+
3676+
def blocks_all(self, representatives=True):
36793677
r"""
36803678
Return the list of block systems of imprimitivity.
36813679

src/sage/groups/perm_gps/permgroup_element.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1849,14 +1849,14 @@ cdef class PermutationGroupElement(MultiplicativeGroupElement):
18491849
[2, 1, 1]
18501850
"""
18511851
cycle_type = [len(c) for c in self.cycle_tuples(singletons)]
1852-
cycle_type.sort(reverse = True)
1852+
cycle_type.sort(reverse=True)
18531853
if as_list:
18541854
return cycle_type
18551855
else:
18561856
from sage.combinat.partition import _Partitions
18571857
return _Partitions(cycle_type)
18581858

1859-
def has_descent(self, i, side = "right", positive = False):
1859+
def has_descent(self, i, side="right", positive=False):
18601860
r"""
18611861
INPUT:
18621862

0 commit comments

Comments
 (0)