Skip to content

Commit c75a027

Browse files
author
Release Manager
committed
gh-39564: some fixes for E114 mostly fixing some E114 warnings about indentation of comments alos full pep8 cleanup in two of the modified files ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #39564 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents c93ee11 + 710acc3 commit c75a027

File tree

9 files changed

+116
-98
lines changed

9 files changed

+116
-98
lines changed

src/sage/dynamics/arithmetic_dynamics/wehlerK3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,8 +2066,8 @@ def fiber(self, p, component):
20662066
Points = []
20672067

20682068
if (self.Gpoly(component,0)(P0) != 0):
2069-
#We are using the quadratic formula, we need this check to ensure that the points
2070-
#will be rational
2069+
# We are using the quadratic formula, we need this check
2070+
# to ensure that the points will be rational
20712071
T0 = (self.Hpoly(component, 0, 1)(P0)**2 - 4*self.Gpoly(component, 0)(P0)*self.Gpoly(component, 1)(P0))
20722072
T1 = (self.Hpoly(component, 0, 2)(P0)**2 - 4*self.Gpoly(component, 0)(P0)*self.Gpoly(component, 2)(P0))
20732073
if (T0.is_square() and T1.is_square()):

src/sage/game_theory/matching_game.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def __eq__(self, other):
493493
zip(set(self._suitors), set(other._suitors))))
494494

495495
__hash__ = None
496-
# not hashable because this is mutable.
496+
# not hashable because this is mutable.
497497

498498
def plot(self):
499499
r"""

src/sage/groups/free_group.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,9 @@ def fox_derivative(self, gen, im_gens=None, ring=None):
457457
R = ring
458458
symb = list(im_gens)
459459
symb += reversed([a**(-1) for a in im_gens])
460-
i = gen.Tietze()[0] # So ``gen`` is the `i`-th
461-
# generator of the free group.
460+
i = gen.Tietze()[0]
461+
# so gen is the i-th generator of the free group
462+
462463
a = R.zero()
463464
coef = R.one()
464465
while l:
@@ -506,7 +507,7 @@ def syllables(self):
506507
for i in range(k):
507508
exponent = exponent_syllable(g, i+1).sage()
508509
generator = gen(generator_syllable(g, i+1).sage() - 1)
509-
result.append( (generator, exponent) )
510+
result.append((generator, exponent))
510511
return tuple(result)
511512

512513
def __call__(self, *values):
@@ -936,6 +937,7 @@ def quotient(self, relations, **kwds):
936937
Finitely presented group < a, b, c, d | a*b*a^-1 >
937938
"""
938939
from sage.groups.finitely_presented import FinitelyPresentedGroup
939-
return FinitelyPresentedGroup(self, tuple(map(self, relations) ), **kwds)
940+
return FinitelyPresentedGroup(self,
941+
tuple(map(self, relations)), **kwds)
940942

941943
__truediv__ = quotient

src/sage/interfaces/maxima.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@
504504
from .expect import (Expect, ExpectElement, gc_disabled)
505505

506506
from .maxima_abstract import (MaximaAbstract, MaximaAbstractFunction,
507-
MaximaAbstractElement,
508-
MaximaAbstractFunctionElement,
509-
MaximaAbstractElementFunction)
507+
MaximaAbstractElement,
508+
MaximaAbstractFunctionElement,
509+
MaximaAbstractElementFunction)
510510
from sage.misc.instancedoc import instancedoc
511511

512512

@@ -586,10 +586,13 @@ def __init__(self, script_subdirectory=None, logfile=None, server=None,
586586
self._ask = [b'zero or nonzero\\?', b'an integer\\?',
587587
b'positive, negative or zero\\?', b'positive or negative\\?',
588588
b'positive or zero\\?', b'equal to .*\\?']
589+
589590
self._prompt_wait = ([self._prompt] +
590591
[re.compile(x) for x in self._ask] +
591-
[b'Break [0-9]+']) # note that you might need to change _expect_expr if you
592-
# change this
592+
[b'Break [0-9]+'])
593+
# note that you might need to change _expect_expr if you
594+
# change this _prompt_wait
595+
593596
self._error_re = re.compile('(Principal Value|debugmode|incorrect syntax|Maxima encountered a Lisp error)')
594597
self._display2d = False
595598

@@ -811,7 +814,7 @@ def _eval_line(self, line, allow_use_file=False,
811814

812815
self._expect_expr()
813816
assert len(self._before()) == 0, \
814-
'Maxima expect interface is confused!'
817+
'Maxima expect interface is confused!'
815818
r = self._output_prompt_re
816819
m = r.search(out)
817820
if m is not None:
@@ -984,7 +987,7 @@ def lisp(self, cmd):
984987
(
985988
"""
986989
self._eval_line(':lisp %s\n""' % cmd, allow_use_file=False,
987-
wait_for_prompt=False, reformat=False, error_check=False)
990+
wait_for_prompt=False, reformat=False, error_check=False)
988991
self._expect_expr('(%i)')
989992
return self._before()
990993

src/sage/modular/pollack_stevens/fund_domain.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,15 +1143,15 @@ def form_list_of_cusps(self):
11431143

11441144
# Initialize some lists
11451145

1146-
C = [QQ(-1), "?", QQ(0)]
1146+
C = [QQ(-1), "?", QQ.zero()]
11471147

11481148
# Initialize the list of cusps at the bottom of the fund. domain.
11491149
# The ? denotes that it has not yet been checked if more cusps need
11501150
# to be added between the surrounding cusps.
11511151

11521152
full_domain = False # Says that we are not done yet!
11531153

1154-
v = [False for r in range(sP)]
1154+
v = [False] * sP
11551155
# This initializes a list indexed by P^1(Z/NZ) which keeps track of
11561156
# which right coset representatives we've found for Gamma_0(N)/SL_2(Z)
11571157
# thru the construction of a fundamental domain
@@ -1171,8 +1171,8 @@ def form_list_of_cusps(self):
11711171
# This loop runs through the current set of cusps
11721172
# and checks to see if more cusps should be added
11731173
# -----------------------------------------------
1174-
for s in range(1, len(C), 2): # range over odd indices in the
1175-
# final list C
1174+
for s in range(1, len(C), 2):
1175+
# range over odd indices in the final list C
11761176
if C[s] == "?":
11771177

11781178
# Single out our two cusps (path from cusp2 to cusp1)
@@ -1188,9 +1188,9 @@ def form_list_of_cusps(self):
11881188
# This is the point where it is determined whether
11891189
# or not the adjacent triangle should be added
11901190
# ------------------------------------------------
1191-
pos = P.index(b2, b1) # The Sage index of the bottom
1192-
# row of our unimodular
1193-
# transformation gam
1191+
pos = P.index(b2, b1)
1192+
# The Sage index of the bottom row of our
1193+
# unimodular transformation gam
11941194

11951195
# Check if we need to flip (since this P1 element has not
11961196
# yet been accounted for!)
@@ -1214,16 +1214,18 @@ def form_list_of_cusps(self):
12141214
# where gam is the matrix corresponding to the
12151215
# unimodular path connecting cusp1 to cusp2
12161216

1217-
C[s] = "i" # The '?' is changed to an 'i'
1218-
# indicating that a new cusp needs to
1219-
# be inserted here
1217+
C[s] = "i"
1218+
# The '?' is changed to an 'i' indicating
1219+
# that a new cusp needs to be inserted here
12201220
full_domain = False
12211221
else:
1222-
C[s] = "x" # The '?' is changed to an 'x' and no
1223-
# more checking below is needed! =)
1222+
C[s] = "x"
1223+
# The '?' is changed to an 'x' and no
1224+
# more checking below is needed! =)
12241225
else:
1225-
C[s] = "x" # The '?' is changed to an 'x' and no more
1226-
# checking below is needed! =)
1226+
C[s] = "x"
1227+
# The '?' is changed to an 'x' and no more
1228+
# checking below is needed! =)
12271229

12281230
# Now insert the missing cusps (where there is an 'i' in
12291231
# the final list)

0 commit comments

Comments
 (0)