Skip to content

Commit 15a0566

Browse files
author
Release Manager
committed
gh-36192: fix E228 then E225 in rings/ fix pycodestyle warnings E228 and E225 in rings done using autopep8 ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36192 Reported by: Frédéric Chapoton Reviewer(s): Frédéric Chapoton, Kwankyu Lee
2 parents 66aacc5 + 39dfddd commit 15a0566

Some content is hidden

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

58 files changed

+303
-302
lines changed

src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ def univariate_decomposition(self):
823823
for a, m in df:
824824
am = a**m
825825
q, r = denominator.quo_rem(am)
826-
assert r==0
826+
assert r == 0
827827
numer = p * q.inverse_mod(am) % am
828828
# The inverse exists because the product and a**m
829829
# are relatively prime.
@@ -1930,7 +1930,7 @@ def asymptotics_smooth(self, p, alpha, N, asy_var, coordinate=None,
19301930
if v.mod(2) == 0:
19311931
At_derivs = diff_all(At, T, 2 * N - 2, sub=hderivs1,
19321932
sub_final=[Tstar, atP], rekey=AA)
1933-
Phitu_derivs = diff_all(Phitu, T, 2 * N - 2 +v,
1933+
Phitu_derivs = diff_all(Phitu, T, 2 * N - 2 + v,
19341934
sub=hderivs1, sub_final=[Tstar, atP],
19351935
zero_order=v + 1, rekey=BB)
19361936
else:

src/sage/rings/complex_interval_field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def _repr_(self):
558558
sage: ComplexIntervalField(100) # indirect doctest
559559
Complex Interval Field with 100 bits of precision
560560
"""
561-
return "Complex Interval Field with %s bits of precision"%self._prec
561+
return "Complex Interval Field with %s bits of precision" % self._prec
562562

563563
def _latex_(self):
564564
r"""

src/sage/rings/finite_rings/conway_polynomials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def find_leveller(qindex, level, x, xleveled, searched, i):
471471
searched[i] = True
472472
crt_possibles = []
473473
for j in range(1,len(qlist)):
474-
if i==j:
474+
if i == j:
475475
continue
476476
if crt[(i,j)][qindex][1] >= level:
477477
if xleveled[j]:
@@ -487,7 +487,7 @@ def find_leveller(qindex, level, x, xleveled, searched, i):
487487

488488
def propagate_levelling(qindex, level, x, xleveled, i):
489489
for j in range(1, len(qlist)):
490-
if i==j:
490+
if i == j:
491491
continue
492492
if not xleveled[j] and crt[(i,j)][qindex][1] >= level:
493493
newxj = x[i][0] + crt[(i,j)][qindex][0]

src/sage/rings/finite_rings/finite_field_givaro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def _pari_modulus(self):
510510
Mod(1, 3)*a^4 + Mod(2, 3)*a^3 + Mod(2, 3)
511511
"""
512512
f = pari(str(self.modulus()))
513-
return f.subst('x', 'a') * pari("Mod(1,%s)"%self.characteristic())
513+
return f.subst('x', 'a') * pari("Mod(1,%s)" % self.characteristic())
514514

515515
def __iter__(self):
516516
"""

src/sage/rings/finite_rings/finite_field_ntl_gf2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,4 @@ def _pari_modulus(self):
305305
Mod(1, 2)*a^16 + Mod(1, 2)*a^5 + Mod(1, 2)*a^3 + Mod(1, 2)*a^2 + Mod(1, 2)
306306
"""
307307
f = pari(str(self.modulus()))
308-
return f.subst('x', 'a') * pari("Mod(1,%s)"%self.characteristic())
308+
return f.subst('x', 'a') * pari("Mod(1,%s)" % self.characteristic())

src/sage/rings/finite_rings/homset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ def _repr_(self):
153153
D = self.domain()
154154
C = self.codomain()
155155
if C == D:
156-
return "Automorphism group of %s"%D
156+
return "Automorphism group of %s" % D
157157
else:
158-
return "Set of field embeddings from %s to %s"%(D, C)
158+
return "Set of field embeddings from %s to %s" % (D, C)
159159

160160
def is_aut(self):
161161
"""

src/sage/rings/function_field/constructor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def create_key(self, F, names):
8686
sage: K.<x> = FunctionField(QQ) # indirect doctest
8787
"""
8888
if not isinstance(names, tuple):
89-
names=(names,)
89+
names = (names,)
9090
return (F, names)
9191

9292
def create_object(self, version, key,**extra_args):
@@ -112,7 +112,7 @@ def create_object(self, version, key,**extra_args):
112112
return RationalFunctionField(key[0], names=key[1])
113113

114114

115-
FunctionField=FunctionFieldFactory("sage.rings.function_field.constructor.FunctionField")
115+
FunctionField = FunctionFieldFactory("sage.rings.function_field.constructor.FunctionField")
116116

117117

118118
class FunctionFieldExtensionFactory(UniqueFactory):
@@ -171,9 +171,9 @@ def create_key(self,polynomial,names):
171171
172172
"""
173173
if names is None:
174-
names=polynomial.variable_name()
174+
names = polynomial.variable_name()
175175
if not isinstance(names,tuple):
176-
names=(names,)
176+
names = (names,)
177177
return (polynomial,names,polynomial.base_ring())
178178

179179
def create_object(self,version,key,**extra_args):

src/sage/rings/function_field/divisor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ def _repr_(self):
10231023
sage: F.divisor_group()
10241024
Divisor group of Function field in y defined by y^2 + 4*x^3 + 4
10251025
"""
1026-
return "Divisor group of %s"%(self._field,)
1026+
return "Divisor group of %s" % (self._field,)
10271027

10281028
def _element_constructor_(self, x):
10291029
"""

src/sage/rings/function_field/function_field_polymod.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def _to_base_field(self, f):
280280
K = self.base_field()
281281
if f.element().is_constant():
282282
return K(f.element())
283-
raise ValueError("%r is not an element of the base field"%(f,))
283+
raise ValueError("%r is not an element of the base field" % (f,))
284284

285285
def _to_constant_base_field(self, f):
286286
"""
@@ -572,7 +572,7 @@ def _repr_(self):
572572
sage: L._repr_()
573573
'Function field in y defined by y^5 - 2*x*y + (-x^4 - 1)/x'
574574
"""
575-
return "Function field in %s defined by %s"%(self.variable_name(), self._polynomial)
575+
return "Function field in %s defined by %s" % (self.variable_name(), self._polynomial)
576576

577577
def base_field(self):
578578
"""

src/sage/rings/function_field/function_field_rational.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def _repr_(self):
220220
sage: K._repr_()
221221
'Rational function field in t over Rational Field'
222222
"""
223-
return "Rational function field in %s over %s"%(
223+
return "Rational function field in %s over %s" % (
224224
self.variable_name(), self._constant_field)
225225

226226
def _element_constructor_(self, x):
@@ -304,7 +304,7 @@ def _to_constant_base_field(self, f):
304304
# When K is not exact, f.denominator() might not be an exact 1, so
305305
# we need to divide explicitly to get the correct precision
306306
return K(f.numerator()) / K(f.denominator())
307-
raise ValueError("only constants can be converted into the constant base field but %r is not a constant"%(f,))
307+
raise ValueError("only constants can be converted into the constant base field but %r is not a constant" % (f,))
308308

309309
def _to_polynomial(self, f):
310310
"""
@@ -349,7 +349,7 @@ def _to_bivariate_polynomial(self, f):
349349
v = f.list()
350350
denom = lcm([a.denominator() for a in v])
351351
S = denom.parent()
352-
x,t = S.base_ring()['%s,%s'%(f.parent().variable_name(),self.variable_name())].gens()
352+
x,t = S.base_ring()['%s,%s' % (f.parent().variable_name(),self.variable_name())].gens()
353353
phi = S.hom([t])
354354
return sum([phi((denom * v[i]).numerator()) * x**i for i in range(len(v))]), denom
355355

0 commit comments

Comments
 (0)