Skip to content

Commit 941ff75

Browse files
author
Release Manager
committed
gh-35549: fixing some pycodestyle warnings E251 <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description This fixes some pycodestyle warnings about E251 unexpected spaces around keyword / parameter equals in some folders starting with letter `m-z` (not touching rings and schemes) This was purely done with autopep8. <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35549 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents 6e3cc34 + 11f844e commit 941ff75

31 files changed

+115
-115
lines changed

src/sage/misc/test_nested_class.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __init__(self):
6363
<sage.misc.test_nested_class.TestParent1_with_category object at ...>
6464
"""
6565
from sage.categories.sets_cat import Sets
66-
Parent.__init__(self, category = Sets())
66+
Parent.__init__(self, category=Sets())
6767

6868
class Element(ElementWrapper):
6969
pass
@@ -80,7 +80,7 @@ def __init__(self):
8080
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
8181
"""
8282
from sage.categories.sets_cat import Sets
83-
Parent.__init__(self, category = Sets())
83+
Parent.__init__(self, category=Sets())
8484

8585
class Element(ElementWrapper):
8686
pass
@@ -96,7 +96,7 @@ def __init__(self):
9696
<sage.misc.test_nested_class.TestParent3_with_category object at ...>
9797
"""
9898
from sage.categories.sets_cat import Sets
99-
Parent.__init__(self, category = Sets())
99+
Parent.__init__(self, category=Sets())
100100

101101
class Element(ElementWrapper):
102102
pass

src/sage/modular/btquotients/pautomorphicform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ def integrate(self, f, center=1, level=0, method='moments'):
19051905
- Marc Masdeu (2012-02-20)
19061906
"""
19071907
E = self.parent()._source._BT.get_balls(center, level)
1908-
R1 = LaurentSeriesRing(f.base_ring(), 'r1', default_prec = self.parent()._U.base_ring().precision_cap() + 1)
1908+
R1 = LaurentSeriesRing(f.base_ring(), 'r1', default_prec=self.parent()._U.base_ring().precision_cap() + 1)
19091909
R2 = PolynomialRing(f.base_ring(), 'x')
19101910
x = R2.gen()
19111911
value = 0
@@ -2605,7 +2605,7 @@ def _make_invariant(self, F):
26052605
m = M[ii]
26062606
for v in Si:
26072607
s += 1
2608-
g = self._Sigma0(m.adjugate() * self._source.embed_quaternion(v[0], prec=self._prec).adjugate() * m,check = False)
2608+
g = self._Sigma0(m.adjugate() * self._source.embed_quaternion(v[0], prec=self._prec).adjugate() * m,check=False)
26092609
newFi += g * x
26102610
newF.append((QQ(1) / s) * newFi)
26112611
else:

src/sage/modular/modform_hecketriangle/abstract_ring.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def _an_element_(self):
258258

259259
return self(self.Delta())
260260

261-
def default_prec(self, prec = None):
261+
def default_prec(self, prec=None):
262262
r"""
263263
Set the default precision ``prec`` for the Fourier expansion.
264264
If ``prec=None`` (default) then the current default precision is returned instead.
@@ -295,7 +295,7 @@ def default_prec(self, prec = None):
295295
else:
296296
return self._prec
297297

298-
def disp_prec(self, prec = None):
298+
def disp_prec(self, prec=None):
299299
r"""
300300
Set the maximal display precision to ``prec``.
301301
If ``prec="max"`` the precision is set to the default precision.
@@ -646,7 +646,7 @@ def rat_field(self):
646646

647647
return self._rat_field
648648

649-
def get_d(self, fix_d = False, d_num_prec = None):
649+
def get_d(self, fix_d=False, d_num_prec=None):
650650
r"""
651651
Return the parameter ``d`` of self either as a formal
652652
parameter or as a numerical approximation with the specified
@@ -715,7 +715,7 @@ def get_d(self, fix_d = False, d_num_prec = None):
715715

716716
return d
717717

718-
def get_q(self, prec = None, fix_d = False, d_num_prec = None):
718+
def get_q(self, prec=None, fix_d=False, d_num_prec=None):
719719
r"""
720720
Return the generator of the power series of the Fourier expansion of ``self``.
721721
@@ -766,7 +766,7 @@ def get_q(self, prec = None, fix_d = False, d_num_prec = None):
766766
prec = self.default_prec()
767767

768768
base_ring = d.parent()
769-
return PowerSeriesRing(FractionField(base_ring), 'q', default_prec = prec).gen()
769+
return PowerSeriesRing(FractionField(base_ring), 'q', default_prec=prec).gen()
770770

771771
@cached_method
772772
def diff_alg(self):
@@ -1039,7 +1039,7 @@ def homogeneous_part(self, k, ep):
10391039
QuasiMeromorphicModularForms(n=7, k=2, ep=-1) over Integer Ring
10401040
"""
10411041

1042-
return self.reduce_type(degree = (k,ep))
1042+
return self.reduce_type(degree=(k,ep))
10431043

10441044
@cached_method
10451045
def J_inv(self):
@@ -1944,7 +1944,7 @@ def EisensteinSeries(self, k=None):
19441944
ep = (-ZZ(1))**(k/2)
19451945
extended_self = self.extend_type(["holo"], ring=True)
19461946
# reduced_self is a classical ModularForms space
1947-
reduced_self = extended_self.reduce_type(["holo"], degree = (QQ(k), ep))
1947+
reduced_self = extended_self.reduce_type(["holo"], degree=(QQ(k), ep))
19481948

19491949
if (n == infinity):
19501950
l2 = ZZ(0)

src/sage/modular/modform_hecketriangle/abstract_space.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def F_simple(self, order_1=ZZ(0)):
835835

836836
return new_space(rat)
837837

838-
def Faber_pol(self, m, order_1=ZZ(0), fix_d = False, d_num_prec = None):
838+
def Faber_pol(self, m, order_1=ZZ(0), fix_d=False, d_num_prec=None):
839839
r"""
840840
Return the ``m``'th Faber polynomial of ``self``.
841841
@@ -985,7 +985,7 @@ def Faber_pol(self, m, order_1=ZZ(0), fix_d = False, d_num_prec = None):
985985
return fab_pol.polynomial()
986986

987987
# very similar to Faber_pol: faber_pol(q)=Faber_pol(d*q)
988-
def faber_pol(self, m, order_1=ZZ(0), fix_d = False, d_num_prec = None):
988+
def faber_pol(self, m, order_1=ZZ(0), fix_d=False, d_num_prec=None):
989989
r"""
990990
If ``n=infinity`` a non-trivial order of ``-1`` can be specified through the
991991
parameter ``order_1`` (default: 0). Otherwise it is ignored.
@@ -2042,7 +2042,7 @@ def construct_quasi_form(self, laurent_series, order_1=ZZ(0), check=True, ration
20422042

20432043
el = self(sum([b[k]*basis[k] for k in range(0, len(basis))]))
20442044
else:
2045-
A = self._quasi_form_matrix(min_exp = min_exp, order_1=order_1)
2045+
A = self._quasi_form_matrix(min_exp=min_exp, order_1=order_1)
20462046
row_size = A.dimensions()[0]
20472047

20482048
if (prec < min_exp + row_size):
@@ -2164,7 +2164,7 @@ def q_basis(self, m=None, min_exp=0, order_1=ZZ(0)):
21642164
if (m >= row_len + min_exp):
21652165
raise ValueError("Index out of range: m={} >= {}=required_precision + min_exp".format(m, row_len + min_exp))
21662166

2167-
A = self._quasi_form_matrix(min_exp = min_exp, order_1=order_1)
2167+
A = self._quasi_form_matrix(min_exp=min_exp, order_1=order_1)
21682168
b = vector(self.coeff_ring(), row_len)
21692169
b[m - min_exp] = 1
21702170
try:
@@ -2180,7 +2180,7 @@ def q_basis(self, m=None, min_exp=0, order_1=ZZ(0)):
21802180

21812181
return el
21822182

2183-
def rationalize_series(self, laurent_series, coeff_bound = 1e-10, denom_factor = ZZ(1)):
2183+
def rationalize_series(self, laurent_series, coeff_bound=1e-10, denom_factor=ZZ(1)):
21842184
r"""
21852185
Try to return a Laurent series with coefficients in ``self.coeff_ring()``
21862186
that matches the given Laurent series.

src/sage/modular/modform_hecketriangle/graded_ring.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class QuasiMeromorphicModularFormsRing(FormsRing_abstract, CommutativeAlgebra, U
6464
"""
6565

6666
@staticmethod
67-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
67+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
6868
r"""
6969
Return a (cached) instance with canonical parameters.
7070
@@ -126,7 +126,7 @@ class QuasiWeakModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRe
126126
"""
127127

128128
@staticmethod
129-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
129+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
130130
r"""
131131
Return a (cached) instance with canonical parameters.
132132
@@ -185,7 +185,7 @@ class QuasiModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepres
185185
"""
186186

187187
@staticmethod
188-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
188+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
189189
r"""
190190
Return a (cached) instance with canonical parameters.
191191
@@ -244,7 +244,7 @@ class QuasiCuspFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresent
244244
"""
245245

246246
@staticmethod
247-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
247+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
248248
r"""
249249
Return a (cached) instance with canonical parameters.
250250
@@ -303,7 +303,7 @@ class MeromorphicModularFormsRing(FormsRing_abstract, CommutativeAlgebra, Unique
303303
"""
304304

305305
@staticmethod
306-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
306+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
307307
r"""
308308
Return a (cached) instance with canonical parameters.
309309
@@ -362,7 +362,7 @@ class WeakModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueReprese
362362
"""
363363

364364
@staticmethod
365-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
365+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
366366
r"""
367367
Return a (cached) instance with canonical parameters.
368368
@@ -421,7 +421,7 @@ class ModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentat
421421
"""
422422

423423
@staticmethod
424-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
424+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
425425
r"""
426426
Return a (cached) instance with canonical parameters.
427427
@@ -479,7 +479,7 @@ class CuspFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation
479479
"""
480480

481481
@staticmethod
482-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, red_hom = False, n=None):
482+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, red_hom=False, n=None):
483483
r"""
484484
Return a (cached) instance with canonical parameters.
485485

src/sage/modular/modform_hecketriangle/graded_ring_element.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ def full_reduce(self):
15231523

15241524
#precision is actually accuracy, maybe add "real precision" meaning number of rel. coef
15251525
@cached_method
1526-
def _q_expansion_cached(self, prec, fix_d, subs_d, d_num_prec, fix_prec = False):
1526+
def _q_expansion_cached(self, prec, fix_d, subs_d, d_num_prec, fix_prec=False):
15271527
"""
15281528
Returns the Fourier expansion of self (cached).
15291529
Don't call this function, instead use :meth:`q_expansion`.
@@ -1590,7 +1590,7 @@ def _q_expansion_cached(self, prec, fix_d, subs_d, d_num_prec, fix_prec = False)
15901590

15911591
return qexp
15921592

1593-
def q_expansion(self, prec = None, fix_d = False, d_num_prec = None, fix_prec = False):
1593+
def q_expansion(self, prec=None, fix_d=False, d_num_prec=None, fix_prec=False):
15941594
"""
15951595
Returns the Fourier expansion of self.
15961596
@@ -1694,7 +1694,7 @@ def q_expansion(self, prec = None, fix_d = False, d_num_prec = None, fix_prec =
16941694

16951695
return self._q_expansion_cached(prec, fix_d, subs_d, d_num_prec, fix_prec)
16961696

1697-
def q_expansion_fixed_d(self, prec = None, d_num_prec = None, fix_prec = False):
1697+
def q_expansion_fixed_d(self, prec=None, d_num_prec=None, fix_prec=False):
16981698
"""
16991699
Returns the Fourier expansion of self.
17001700
The numerical (or exact) value for ``d`` is substituted.
@@ -1756,7 +1756,7 @@ def q_expansion_fixed_d(self, prec = None, d_num_prec = None, fix_prec = False):
17561756

17571757
return self.q_expansion(prec, True, d_num_prec, fix_prec)
17581758

1759-
def q_expansion_vector(self, min_exp = None, max_exp = None, prec = None, **kwargs):
1759+
def q_expansion_vector(self, min_exp=None, max_exp=None, prec=None, **kwargs):
17601760
r"""
17611761
Return (part of) the Laurent series expansion of ``self`` as a vector.
17621762
@@ -1827,7 +1827,7 @@ def q_expansion_vector(self, min_exp = None, max_exp = None, prec = None, **kwar
18271827

18281828
return vector([qexp[m] for m in range(min_exp, max_exp +1)])
18291829

1830-
def evaluate(self, tau, prec = None, num_prec = None, check=False):
1830+
def evaluate(self, tau, prec=None, num_prec=None, check=False):
18311831
r"""
18321832
Try to return ``self`` evaluated at a point ``tau``
18331833
in the upper half plane, where ``self`` is interpreted
@@ -2203,7 +2203,7 @@ def evaluate(self, tau, prec = None, num_prec = None, check=False):
22032203
f_rho = self.parent().graded_ring().f_rho()
22042204
return self._rat.subs(x=f_rho(tau), y=f_i(tau), z=E2(tau), d=dval)
22052205

2206-
def __call__(self, tau, prec = None, num_prec = None, check=False):
2206+
def __call__(self, tau, prec=None, num_prec=None, check=False):
22072207
r"""
22082208
Try to return ``self`` evaluated at a point ``tau``
22092209
in the upper half plane, where ``self`` is interpreted

src/sage/modular/modform_hecketriangle/space.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class QuasiMeromorphicModularForms(FormsSpace_abstract, Module, UniqueRepresenta
8585
"""
8686

8787
@staticmethod
88-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
88+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
8989
r"""
9090
Return a (cached) instance with canonical parameters.
9191
@@ -131,7 +131,7 @@ class QuasiWeakModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
131131
"""
132132

133133
@staticmethod
134-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
134+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
135135
r"""
136136
Return a (cached) instance with canonical parameters.
137137
@@ -178,7 +178,7 @@ class QuasiModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
178178
"""
179179

180180
@staticmethod
181-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
181+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
182182
r"""
183183
Return a (cached) instance with canonical parameters.
184184
@@ -340,7 +340,7 @@ class QuasiCuspForms(FormsSpace_abstract, Module, UniqueRepresentation):
340340
"""
341341

342342
@staticmethod
343-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
343+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
344344
r"""
345345
Return a (cached) instance with canonical parameters.
346346
@@ -512,7 +512,7 @@ class MeromorphicModularForms(FormsSpace_abstract, Module, UniqueRepresentation)
512512
"""
513513

514514
@staticmethod
515-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
515+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
516516
r"""
517517
Return a (cached) instance with canonical parameters.
518518
@@ -559,7 +559,7 @@ class WeakModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
559559
"""
560560

561561
@staticmethod
562-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
562+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
563563
r"""
564564
Return a (cached) instance with canonical parameters.
565565
@@ -604,7 +604,7 @@ class ModularForms(FormsSpace_abstract, Module, UniqueRepresentation):
604604
"""
605605

606606
@staticmethod
607-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
607+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
608608
r"""
609609
Return a (cached) instance with canonical parameters.
610610
@@ -747,7 +747,7 @@ def coordinate_vector(self, v):
747747
(1, 1/(2*d), 15/(128*d^2))
748748
"""
749749

750-
vec = v.q_expansion_vector(min_exp = 0, max_exp = self.degree() - 1)
750+
vec = v.q_expansion_vector(min_exp=0, max_exp=self.degree() - 1)
751751
return self._module(vec)
752752

753753
class CuspForms(FormsSpace_abstract, Module, UniqueRepresentation):
@@ -757,7 +757,7 @@ class CuspForms(FormsSpace_abstract, Module, UniqueRepresentation):
757757
"""
758758

759759
@staticmethod
760-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
760+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
761761
r"""
762762
Return a (cached) instance with canonical parameters.
763763
@@ -899,7 +899,7 @@ def coordinate_vector(self, v):
899899
True
900900
"""
901901

902-
vec = v.q_expansion_vector(min_exp = 1, max_exp = self.degree())
902+
vec = v.q_expansion_vector(min_exp=1, max_exp=self.degree())
903903
return self._module(vec)
904904

905905
class ZeroForm(FormsSpace_abstract, Module, UniqueRepresentation):
@@ -909,7 +909,7 @@ class ZeroForm(FormsSpace_abstract, Module, UniqueRepresentation):
909909
"""
910910

911911
@staticmethod
912-
def __classcall__(cls, group = HeckeTriangleGroup(3), base_ring = ZZ, k=QQ(0), ep=None, n=None):
912+
def __classcall__(cls, group=HeckeTriangleGroup(3), base_ring=ZZ, k=QQ(0), ep=None, n=None):
913913
r"""
914914
Return a (cached) instance with canonical parameters.
915915

0 commit comments

Comments
 (0)