Skip to content

Commit 273d12b

Browse files
author
Release Manager
committed
Trac #34910: autopep8 for E3 in combinat/
except in the designs/ and matrices/ subfolders of combinat done using {{{autopep8 -i --select=E3 *.py}}} URL: https://trac.sagemath.org/34910 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Matthias Koeppe
2 parents 0bf8cd2 + c29eb40 commit 273d12b

File tree

221 files changed

+920
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+920
-206
lines changed

src/sage/combinat/abstract_tree.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class AbstractTree():
109109
sage: TestSuite(OrderedTree()).run()
110110
sage: TestSuite(BinaryTree()).run()
111111
"""
112+
112113
def pre_order_traversal_iter(self):
113114
r"""
114115
The depth-first pre-order traversal iterator.
@@ -1828,6 +1829,7 @@ class or one of its subclasses generally, at least :class:`ClonableArray
18281829
18291830
See also the assumptions in :class:`AbstractTree`.
18301831
"""
1832+
18311833
def check(self):
18321834
"""
18331835
Check that ``self`` is a correct tree.
@@ -2044,6 +2046,7 @@ class AbstractLabelledTree(AbstractTree):
20442046
20452047
.. SEEALSO:: :class:`AbstractTree`
20462048
"""
2049+
20472050
def __init__(self, parent, children, label=None, check=True):
20482051
"""
20492052
TESTS::
@@ -2321,6 +2324,7 @@ class AbstractLabelledClonableTree(AbstractLabelledTree,
23212324
here from :class:`~sage.structure.list_clone.ClonableArray`, because it would prevent us to
23222325
inherit later from :class:`~sage.structure.list_clone.ClonableList`.
23232326
"""
2327+
23242328
def set_root_label(self, label):
23252329
"""
23262330
Set the label of the root of ``self``.

src/sage/combinat/affine_permutation.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class AffinePermutation(ClonableArray):
4242
sage: p
4343
Type A affine permutation with window [3, -1, 0, 6, 5, 4, 10, 9]
4444
"""
45+
4546
def __init__(self, parent, lst, check=True):
4647
r"""
4748
Initialize ``self``
@@ -407,7 +408,6 @@ def grassmannian_quotient(self, i=0, side='right'):
407408
return (fin, gr)
408409

409410

410-
411411
class AffinePermutationTypeA(AffinePermutation):
412412
#----------------------
413413
#Type-specific methods.
@@ -448,7 +448,6 @@ def check(self):
448448
if l != list(range(k+1)):
449449
raise ValueError("entries must have distinct residues")
450450

451-
452451
def value(self, i, base_window=False):
453452
r"""
454453
Return the image of the integer ``i`` under this permutation.
@@ -730,7 +729,6 @@ def maximal_cyclic_factor(self, typ='decreasing', side='right', verbose=False):
730729
best_T.reverse()
731730
return best_T
732731

733-
734732
def maximal_cyclic_decomposition(self, typ='decreasing', side='right', verbose=False):
735733
r"""
736734
Find the unique maximal decomposition of ``self`` into cyclically
@@ -1065,6 +1063,8 @@ def tableau_of_word(self, w, typ='decreasing', side='right', alpha=None):
10651063
return tab
10661064

10671065
#-------------------------------------------------------------------------------
1066+
1067+
10681068
class AffinePermutationTypeC(AffinePermutation):
10691069
#----------------------
10701070
#Type-specific methods.
@@ -1321,7 +1321,6 @@ def check(self):
13211321
raise ValueError("type B affine permutations have an even number of "
13221322
"entries less than 0 to the right of the 0th position")
13231323

1324-
13251324
def apply_simple_reflection_right(self, i):
13261325
r"""
13271326
Apply the simple reflection indexed by ``i`` on positions.
@@ -1843,8 +1842,6 @@ def to_type_a(self):
18431842
return A(self)
18441843

18451844

1846-
1847-
18481845
#-------------------------------------------------------------------------
18491846
# Class of all affine permutations.
18501847
#-------------------------------------------------------------------------

src/sage/combinat/alternating_sign_matrix.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,7 @@ class AlternatingSignMatrices(UniqueRepresentation, Parent):
10461046
sage: L.category()
10471047
Category of facade finite enumerated lattice posets
10481048
"""
1049+
10491050
def __init__(self, n):
10501051
r"""
10511052
Initialize ``self``.
@@ -1657,6 +1658,7 @@ class MonotoneTriangles(GelfandTsetlinPatternsTopRow):
16571658
sage: all(A.from_monotone_triangle(m).to_monotone_triangle() == m for m in M)
16581659
True
16591660
"""
1661+
16601662
def __init__(self, n):
16611663
r"""
16621664
Initialize ``self``.

src/sage/combinat/backtrack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class GenericBacktracker():
4444
See also :class:`RecursivelyEnumeratedSet_forest` for
4545
handling simple special cases.
4646
"""
47+
4748
def __init__(self, initial_data, initial_state):
4849
r"""
4950
EXAMPLES::
@@ -127,6 +128,7 @@ class PositiveIntegerSemigroup(UniqueRepresentation, RecursivelyEnumeratedSet_fo
127128
sage: TestSuite(PP).run(skip='_test_enumerated_set_contains')
128129
sage: PP._test_enumerated_set_contains() # long time
129130
"""
131+
130132
def __init__(self):
131133
r"""
132134
TESTS::

src/sage/combinat/baxter_permutations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class BaxterPermutations_size(BaxterPermutations):
7070
sage: BaxterPermutations_size(5)
7171
Baxter permutations of size 5
7272
"""
73+
7374
def __init__(self, n):
7475
"""
7576
EXAMPLES::
@@ -252,6 +253,7 @@ class BaxterPermutations_all(DisjointUnionEnumeratedSets, BaxterPermutations):
252253
sage: BaxterPermutations_all()
253254
Baxter permutations
254255
"""
256+
255257
def __init__(self, n=None):
256258
r"""
257259
EXAMPLES::

src/sage/combinat/binary_recurrence_sequences.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class BinaryRecurrenceSequence(SageObject):
105105
"""
106106

107107
def __init__(self, b, c, u0=0, u1=1):
108-
109108
"""
110109
See :class:`BinaryRecurrenceSequence` for full documentation.
111110
@@ -830,7 +829,6 @@ def _goodness(n, R, p):
830829

831830

832831
def _next_good_prime(p, R, qq, patience, qqold):
833-
834832
"""
835833
Find the next prime `\\ell` which is good by ``qq`` but not by ``qqold``, 1 mod ``p``, and for which
836834
``b^2+4*c`` is a square mod `\\ell`, for the sequence ``R`` if it is possible in runtime patience.
@@ -1033,7 +1031,6 @@ def _is_p_power_mod(a, p, N):
10331031

10341032

10351033
def _estimated_time(M2, M1, length, p):
1036-
10371034
"""
10381035
Find the estimated time to extend congruences mod M1 to consistent congruences mod M2.
10391036

src/sage/combinat/binary_tree.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4179,6 +4179,7 @@ class BinaryTrees_size(BinaryTrees):
41794179
sage: from sage.combinat.binary_tree import BinaryTrees_size
41804180
sage: for i in range(6): TestSuite(BinaryTrees_size(i)).run()
41814181
"""
4182+
41824183
def __init__(self, size):
41834184
"""
41844185
TESTS::
@@ -4318,6 +4319,7 @@ class FullBinaryTrees_all(DisjointUnionEnumeratedSets, BinaryTrees):
43184319
"""
43194320
All full binary trees.
43204321
"""
4322+
43214323
def __init__(self):
43224324
"""
43234325
TESTS::
@@ -4415,6 +4417,7 @@ class FullBinaryTrees_size(BinaryTrees):
44154417
"""
44164418
Full binary trees of a fixed size (number of nodes).
44174419
"""
4420+
44184421
def __init__(self, size):
44194422
r"""
44204423
TESTS::
@@ -5157,6 +5160,7 @@ class LabelledBinaryTrees(LabelledOrderedTrees):
51575160
This is a parent stub to serve as a factory class for trees with various
51585161
labels constraints.
51595162
"""
5163+
51605164
def _repr_(self):
51615165
"""
51625166
TESTS::

src/sage/combinat/blob_algebra.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
from sage.combinat.dyck_word import DyckWords
3434

3535
#@add_metaclass(InheritComparisonClasscallMetaclass)
36+
37+
3638
class BlobDiagram(Element):
3739
r"""
3840
A blob diagram.
@@ -45,6 +47,7 @@ class BlobDiagram(Element):
4547
those without. The blobed pairs must either be either the leftmost
4648
propagating strand or to the left of it and not nested.
4749
"""
50+
4851
def __init__(self, parent, marked, unmarked):
4952
r"""
5053
Initialize ``self``.
@@ -148,10 +151,12 @@ def temperley_lieb_diagram(self):
148151
"""
149152
return self.parent()._TL_diagrams(self.marked + self.unmarked)
150153

154+
151155
class BlobDiagrams(Parent, UniqueRepresentation):
152156
r"""
153157
The set of all blob diagrams.
154158
"""
159+
155160
def __init__(self, n):
156161
r"""
157162
Initialize ``self``.
@@ -370,6 +375,7 @@ def __iter__(self):
370375

371376
Element = BlobDiagram
372377

378+
373379
class BlobAlgebra(CombinatorialFreeModule):
374380
r"""
375381
The blob algebra.

src/sage/combinat/cartesian_product.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class for ``cartesian_product``;
7474
sage: elt.parent() is c
7575
True
7676
"""
77+
7778
def __init__(self, *iters):
7879
"""
7980
TESTS::

src/sage/combinat/cluster_algebra_quiver/cluster_seed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class ClusterSeed(SageObject):
130130
sage: S = ClusterSeed(['D', 4],user_labels = [-1, 0, 1, 2]);S
131131
A seed for a cluster algebra of rank 4 of type ['D', 4]
132132
"""
133+
133134
def __init__(self, data, frozen=None, is_principal=False, user_labels=None, user_labels_prefix='x'):
134135
r"""
135136
@@ -3443,7 +3444,6 @@ def mutation_class_iter(self, depth=infinity, show_depth=False,
34433444
else:
34443445
yield self
34453446

3446-
34473447
# instantiate the variables
34483448
clusters = {}
34493449
clusters[ cl ] = [ self, list(range(n)), [] ]
@@ -4628,6 +4628,7 @@ def coeff_recurs(p, q, a1, a2, b, c):
46284628
return sum((-1)**(k-1)*coeff_recurs(p, q-k, a1, a2, b, c)*_bino(a1-b*p+k-1, k)
46294629
for k in range(1, q+1))
46304630

4631+
46314632
def PathSubset(n, m):
46324633
r"""
46334634
Encodes a *maximal* Dyck path from (0,0) to (n,m) (for n >= m >= 0) as a subset of {0,1,2,..., 2n-1}.
@@ -4687,6 +4688,7 @@ def SetToPath(T):
46874688
ans.append(2*n-2)
46884689
return ans
46894690

4691+
46904692
def is_LeeLiZel_allowable(T,n,m,b,c):
46914693
"""
46924694
Check if the subset T contributes to the computation of the greedy

0 commit comments

Comments
 (0)