Skip to content

Commit f36f46c

Browse files
author
Release Manager
committed
Trac #34588: fix some E251 in modular
URL: https://trac.sagemath.org/34588 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Matthias Koeppe
2 parents 888a82e + 18478ca commit f36f46c

23 files changed

+109
-103
lines changed

src/sage/algebras/clifford_algebra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ def _basis_index_function(self, x):
666666
# if the input is a tuple, assume that it has
667667
# entries in {0, ..., 2**Q.dim()-1}
668668
if isinstance(x, tuple):
669-
return FrozenBitset(x, capacity = Q.dim())
669+
return FrozenBitset(x, capacity=Q.dim())
670670

671671
# slice the output of format in order to make conventions
672672
# of format and FrozenBitset agree.

src/sage/modular/abvar/cuspidal_subgroup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,11 @@ def lattice(self):
241241
try:
242242
return self.__lattice
243243
except AttributeError:
244-
lattice = self._compute_lattice(rational_only = False)
244+
lattice = self._compute_lattice(rational_only=False)
245245
self.__lattice = lattice
246246
return lattice
247247

248+
248249
class RationalCuspSubgroup(CuspidalSubgroup_generic):
249250
"""
250251
EXAMPLES::
@@ -292,10 +293,11 @@ def lattice(self):
292293
try:
293294
return self.__lattice
294295
except AttributeError:
295-
lattice = self._compute_lattice(rational_only = True)
296+
lattice = self._compute_lattice(rational_only=True)
296297
self.__lattice = lattice
297298
return lattice
298299

300+
299301
class RationalCuspidalSubgroup(CuspidalSubgroup_generic):
300302
"""
301303
EXAMPLES::
@@ -342,7 +344,7 @@ def lattice(self):
342344
try:
343345
return self.__lattice
344346
except AttributeError:
345-
lattice = self._compute_lattice(rational_subgroup = True)
347+
lattice = self._compute_lattice(rational_subgroup=True)
346348
self.__lattice = lattice
347349
return lattice
348350

src/sage/modular/abvar/finite_subgroup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def __mul__(self, right):
461461
"""
462462
lattice = self.lattice().scale(right)
463463
return FiniteSubgroup_lattice(self.abelian_variety(), lattice,
464-
field_of_definition = self.field_of_definition())
464+
field_of_definition=self.field_of_definition())
465465

466466
def __rmul__(self, left):
467467
"""

src/sage/modular/abvar/morphism.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ def _image_of_finite_subgroup(self, G):
546546
B = G._relative_basis_matrix() * self.restrict_domain(G.abelian_variety()).matrix() * self.codomain().lattice().basis_matrix()
547547
lattice = B.row_module(ZZ)
548548
return self.codomain().finite_subgroup(lattice,
549-
field_of_definition = G.field_of_definition())
549+
field_of_definition=G.field_of_definition())
550550

551551
def _image_of_abvar(self, A):
552552
"""

src/sage/modular/arithgroup/arithgroup_generic.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def _find_cusps(self):
744744
so this should usually be overridden in subclasses; but it doesn't have
745745
to be.
746746
"""
747-
i = Cusp([1,0])
747+
i = Cusp([1, 0])
748748
L = [i]
749749
for a in self.coset_reps():
750750
ai = i.apply([a.a(), a.b(), a.c(), a.d()])
@@ -757,11 +757,12 @@ def _find_cusps(self):
757757
L.append(ai)
758758
return L
759759

760-
def are_equivalent(self, x, y, trans = False):
760+
def are_equivalent(self, x, y, trans=False):
761761
r"""
762-
Test whether or not cusps x and y are equivalent modulo self. If self
763-
has a reduce_cusp() method, use that; otherwise do a slow explicit
764-
test.
762+
Test whether or not cusps x and y are equivalent modulo self.
763+
764+
If self has a reduce_cusp() method, use that; otherwise do a
765+
slow explicit test.
765766
766767
If trans = False, returns True or False. If trans = True, then return
767768
either False or an element of self mapping x onto y.

src/sage/modular/hecke/submodule.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from . import module
2828

2929

30-
3130
def is_HeckeSubmodule(x):
3231
r"""
3332
Return True if x is of type HeckeSubmodule.
@@ -553,8 +552,8 @@ def dual_free_module(self, bound=None, anemic=True, use_star=True):
553552
# then we compute the dual on each eigenspace, then put them
554553
# together.
555554
if len(self.star_eigenvalues()) == 2:
556-
V = self.plus_submodule(compute_dual = False).dual_free_module() + \
557-
self.minus_submodule(compute_dual = False).dual_free_module()
555+
V = self.plus_submodule(compute_dual=False).dual_free_module() + \
556+
self.minus_submodule(compute_dual=False).dual_free_module()
558557
return V
559558

560559
# At this point, we know that self is an eigenspace for star.

src/sage/modular/local_comp/type_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
@cached_function
36-
def example_type_space(example_no = 0):
36+
def example_type_space(example_no=0):
3737
r"""
3838
Quickly return an example of a type space. Used mainly to speed up
3939
doctesting.

src/sage/modular/modform/ambient_eps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ def change_ring(self, base_ring):
198198
"""
199199
if self.base_ring() == base_ring:
200200
return self
201-
return ambient_R.ModularFormsAmbient_R(self, base_ring = base_ring)
201+
return ambient_R.ModularFormsAmbient_R(self, base_ring=base_ring)
202202

203-
@cached_method(key=lambda self,sign: rings.Integer(sign)) # convert sign to an Integer before looking this up in the cache
203+
@cached_method(key=lambda self, sign: rings.Integer(sign)) # convert sign to an Integer before looking this up in the cache
204204
def modular_symbols(self, sign=0):
205205
"""
206206
Return corresponding space of modular symbols with given sign.
@@ -222,9 +222,9 @@ def modular_symbols(self, sign=0):
222222
"""
223223
sign = rings.Integer(sign)
224224
return modsym.ModularSymbols(self.character(),
225-
weight = self.weight(),
226-
sign = sign,
227-
base_ring = self.base_ring())
225+
weight=self.weight(),
226+
sign=sign,
227+
base_ring=self.base_ring())
228228

229229
@cached_method
230230
def eisenstein_submodule(self):

src/sage/modular/modform/constructor.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ def ModularForms_clear_cache():
153153
global _cache
154154
_cache = {}
155155

156-
def ModularForms(group = 1,
157-
weight = 2,
158-
base_ring = None,
156+
157+
def ModularForms(group=1,
158+
weight=2,
159+
base_ring=None,
159160
eis_only=False,
160-
use_cache = True,
161-
prec = defaults.DEFAULT_PRECISION):
161+
use_cache=True,
162+
prec=defaults.DEFAULT_PRECISION):
162163
r"""
163164
Create an ambient space of modular forms.
164165
@@ -346,8 +347,8 @@ def ModularForms(group = 1,
346347
eps = eps.minimize_base_ring()
347348
if eps.is_trivial():
348349
return ModularForms(eps.modulus(), weight, base_ring,
349-
use_cache = use_cache,
350-
prec = prec)
350+
use_cache=use_cache,
351+
prec=prec)
351352
M = ModularFormsAmbient_eps(eps, weight, eis_only=eis_only)
352353
if base_ring != eps.base_ring():
353354
M = M.base_extend(base_ring) # ambient_R.ModularFormsAmbient_R(M, base_ring)
@@ -360,11 +361,11 @@ def ModularForms(group = 1,
360361
return M
361362

362363

363-
def CuspForms(group = 1,
364-
weight = 2,
365-
base_ring = None,
366-
use_cache = True,
367-
prec = defaults.DEFAULT_PRECISION):
364+
def CuspForms(group=1,
365+
weight=2,
366+
base_ring=None,
367+
use_cache=True,
368+
prec=defaults.DEFAULT_PRECISION):
368369
"""
369370
Create a space of cuspidal modular forms.
370371
@@ -380,13 +381,13 @@ def CuspForms(group = 1,
380381
use_cache=use_cache, prec=prec).cuspidal_submodule()
381382

382383

383-
def EisensteinForms(group = 1,
384-
weight = 2,
385-
base_ring = None,
386-
use_cache = True,
387-
prec = defaults.DEFAULT_PRECISION):
384+
def EisensteinForms(group=1,
385+
weight=2,
386+
base_ring=None,
387+
use_cache=True,
388+
prec=defaults.DEFAULT_PRECISION):
388389
"""
389-
Create a space of eisenstein modular forms.
390+
Create a space of Eisenstein modular forms.
390391
391392
See the documentation for the ModularForms command for a
392393
description of the input parameters.
@@ -396,15 +397,14 @@ def EisensteinForms(group = 1,
396397
sage: EisensteinForms(11,2)
397398
Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
398399
"""
399-
if weight==1:
400+
if weight == 1:
400401
return ModularForms(group, weight, base_ring,
401402
use_cache=use_cache, eis_only=True, prec=prec).eisenstein_submodule()
402403
else:
403404
return ModularForms(group, weight, base_ring,
404405
use_cache=use_cache, prec=prec).eisenstein_submodule()
405406

406407

407-
408408
def Newforms(group, weight=2, base_ring=None, names=None):
409409
r"""
410410
Returns a list of the newforms of the given weight and level (or weight,

src/sage/modular/modform/cuspidal_submodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def _compute_q_expansion_basis(self, prec=None):
236236
prec = Integer(prec)
237237
if self.dimension() == 0:
238238
return []
239-
M = self.modular_symbols(sign = 1)
239+
M = self.modular_symbols(sign=1)
240240
return M.q_expansion_basis(prec)
241241

242242
def _compute_hecke_matrix_prime(self, p):

0 commit comments

Comments
 (0)