Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 9567e09

Browse files
committed
fix E251 in groups
1 parent 12be2d9 commit 9567e09

11 files changed

+37
-31
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

+9-8
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ def AssionGroupS(n=None, names='s'):
194194
sage: S3 == S3x
195195
True
196196
"""
197-
return CubicBraidGroup(n = n, names = names, cbg_type=CubicBraidGroup.type.AssionS)
197+
return CubicBraidGroup(n=n, names=names,
198+
cbg_type=CubicBraidGroup.type.AssionS)
198199

199200

200201
def AssionGroupU(n=None, names='u'):
@@ -222,9 +223,9 @@ def AssionGroupU(n=None, names='u'):
222223
Assion group on 3 strands of type U
223224
sage: U3 == U3x
224225
True
225-
226226
"""
227-
return CubicBraidGroup(n = n, names = names, cbg_type=CubicBraidGroup.type.AssionU)
227+
return CubicBraidGroup(n=n, names=names,
228+
cbg_type=CubicBraidGroup.type.AssionU)
228229

229230

230231

@@ -367,9 +368,9 @@ class :class:`Braid`.
367368
braid_group = self.parent().braid_group()
368369
return braid_group(self)
369370

370-
371371
@cached_method
372-
def burau_matrix(self, root_bur = None, domain = None, characteristic = None, var='t', reduced=False):
372+
def burau_matrix(self, root_bur=None, domain=None, characteristic=None,
373+
var='t', reduced=False):
373374
r"""
374375
Return the Burau matrix of the cubic braid coset.
375376
@@ -2022,10 +2023,10 @@ def is_finite(self):
20222023
from sage.rings.infinity import infinity
20232024
return not self.order() is infinity
20242025

2025-
# ----------------------------------------------------------------------------------
2026+
# ------------------------------------------------------------------
20262027
# creating a CubicBraidGroup as subgroup of self on less strands
2027-
# ----------------------------------------------------------------------------------
2028-
def cubic_braid_subgroup(self, nstrands = None):
2028+
# ------------------------------------------------------------------
2029+
def cubic_braid_subgroup(self, nstrands=None):
20292030
r"""
20302031
Creates a cubic braid group as subgroup of ``self`` on the first ``nstrands`` strands.
20312032

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
@@ -2781,7 +2781,7 @@ def semidirect_product(self, N, mapping, check=True):
27812781
from sage.categories.finite_permutation_groups import FinitePermutationGroups
27822782
if N not in FinitePermutationGroups():
27832783
raise TypeError("{0} is not a permutation group".format(N))
2784-
if not PermutationGroup(gens = mapping[0]) == self:
2784+
if not PermutationGroup(gens=mapping[0]) == self:
27852785
msg = 'the generator list must generate the calling group, {0} does not generate {1}'
27862786
raise ValueError(msg.format(mapping[0], self._repr_()))
27872787
if len(mapping[0]) != len(mapping[1]):
@@ -3159,7 +3159,7 @@ def commutator(self, other=None):
31593159
return PermutationGroup(gap_group=gap_group)
31603160

31613161
@hap_decorator
3162-
def cohomology(self, n, p = 0):
3162+
def cohomology(self, n, p=0):
31633163
r"""
31643164
Computes the group cohomology `H^n(G, F)`, where `F = \ZZ`
31653165
if `p=0` and `F = \ZZ / p \ZZ` if `p > 0` is a prime.
@@ -3208,7 +3208,7 @@ def cohomology(self, n, p = 0):
32083208
return AbelianGroup(len(L), L)
32093209

32103210
@hap_decorator
3211-
def cohomology_part(self, n, p = 0):
3211+
def cohomology_part(self, n, p=0):
32123212
r"""
32133213
Compute the p-part of the group cohomology `H^n(G, F)`,
32143214
where `F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if
@@ -3244,7 +3244,7 @@ def cohomology_part(self, n, p = 0):
32443244
return AbelianGroup(len(L), L)
32453245

32463246
@hap_decorator
3247-
def homology(self, n, p = 0):
3247+
def homology(self, n, p=0):
32483248
r"""
32493249
Computes the group homology `H_n(G, F)`, where
32503250
`F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if
@@ -3292,7 +3292,7 @@ def homology(self, n, p = 0):
32923292
return AbelianGroup(len(L), L)
32933293

32943294
@hap_decorator
3295-
def homology_part(self, n, p = 0):
3295+
def homology_part(self, n, p=0):
32963296
r"""
32973297
Computes the `p`-part of the group homology
32983298
`H_n(G, F)`, where `F = \ZZ` if `p=0` and
@@ -3616,7 +3616,7 @@ def _regular_subgroup_gap(self):
36163616
return C
36173617

36183618
@cached_method
3619-
def has_regular_subgroup(self, return_group = False):
3619+
def has_regular_subgroup(self, return_group=False):
36203620
r"""
36213621
Return whether the group contains a regular subgroup.
36223622
@@ -3656,12 +3656,10 @@ def has_regular_subgroup(self, return_group = False):
36563656
b = (C is not None)
36573657
if b and return_group:
36583658
G = self.subgroup(gap_group=C.Representative())
3659-
if return_group:
3660-
return G
3661-
else:
3662-
return b
36633659

3664-
def blocks_all(self, representatives = True):
3660+
return G if return_group else b
3661+
3662+
def blocks_all(self, representatives=True):
36653663
r"""
36663664
Return the list of block systems of imprimitivity.
36673665

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
"""
18611861
INPUT:
18621862

0 commit comments

Comments
 (0)