Skip to content

Commit 5a339e1

Browse files
committed
fix some pep in words
1 parent 54cd6fe commit 5a339e1

File tree

7 files changed

+129
-32
lines changed

7 files changed

+129
-32
lines changed

src/sage/combinat/words/finite_word.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5949,7 +5949,6 @@ def sturmian_desubstitute_as_possible(self):
59495949
desubstitued_word = desubstitued_word + w_running ** (current_run_length - min_run)
59505950
return desubstitued_word.sturmian_desubstitute_as_possible()
59515951

5952-
59535952
def is_sturmian_factor(self):
59545953
r"""
59555954
Tell whether ``self`` is a factor of a Sturmian word.
@@ -6010,7 +6009,6 @@ def is_sturmian_factor(self):
60106009
"""
60116010
return self.sturmian_desubstitute_as_possible().is_empty()
60126011

6013-
60146012
def is_tangent(self):
60156013
r"""
60166014
Tell whether ``self`` is a tangent word.
@@ -6080,7 +6078,6 @@ def is_tangent(self):
60806078
mini = min(mini , height)
60816079
return (maxi - mini <= 2)
60826080

6083-
60846081
# TODO.
60856082
# 1. Those three swap functions should use the cmp of python.
60866083
# 2. The actual code should then be copied as is in the Word_over_Alphabet
@@ -7175,7 +7172,6 @@ def minimal_conjugate(self):
71757172
if end >= p.length():
71767173
return factor ** q
71777174

7178-
#######################################################################
71797175

71807176
class CallableFromListOfWords(tuple):
71817177
r"""
@@ -7222,6 +7218,7 @@ def __call__(self, i):
72227218
j -= c.length()
72237219
raise IndexError("index (=%s) out of range" % i)
72247220

7221+
72257222
class Factorization(list):
72267223
r"""
72277224
A list subclass having a nicer representation for factorization of words.
@@ -7245,6 +7242,7 @@ def __repr__(self):
72457242
"""
72467243
return '(%s)' % ', '.join(w.string_rep() for w in self)
72477244

7245+
72487246
#######################################################################
72497247

72507248
def evaluation_dict(w):
@@ -7270,13 +7268,13 @@ def evaluation_dict(w):
72707268
72717269
sage: evaluation_dict('1213121') # keys appear in random order
72727270
{'1': 4, '2': 2, '3': 1}
7273-
72747271
"""
72757272
d = defaultdict(int)
72767273
for a in w:
72777274
d[a] += 1
72787275
return dict(d)
72797276

7277+
72807278
def word_to_ordered_set_partition(w):
72817279
r"""
72827280
Return the ordered set partition corresponding to a finite

src/sage/combinat/words/lyndon_word.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ def standard_bracketing(lw):
613613
if lw[i:] in LyndonWords():
614614
return [standard_bracketing(lw[:i]), standard_bracketing(lw[i:])]
615615

616+
616617
def standard_unbracketing(sblw):
617618
"""
618619
Return flattened ``sblw`` if it is a standard bracketing of a Lyndon word,

0 commit comments

Comments
 (0)