Skip to content

Commit ce36eba

Browse files
author
Release Manager
committed
Trac #34320: fix E251 in schemes
about {{{ E251 unexpected spaces around keyword / parameter equals }}} URL: https://trac.sagemath.org/34320 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): David Coudert
2 parents e30ca6d + a7949bf commit ce36eba

21 files changed

+105
-105
lines changed

src/sage/schemes/berkovich/berkovich_space.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,11 @@ def __init__(self, base, ideal=None):
647647
ideal = None
648648
self._base_type = 'padic field'
649649
if base.dimension_relative() != 1:
650-
raise ValueError("base of projective Berkovich space must be " + \
650+
raise ValueError("base of projective Berkovich space must be "
651651
"projective space of dimension 1 over Qp or a number field")
652652
self._p = prime
653653
self._ideal = ideal
654-
Parent.__init__(self, base = base, category=TopologicalSpaces())
654+
Parent.__init__(self, base=base, category=TopologicalSpaces())
655655

656656
def base_ring(self):
657657
r"""

src/sage/schemes/curves/affine_curve.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def local_coordinates(self, pt, n):
395395
y0 = F(pt[1])
396396
astr = ["a"+str(i) for i in range(1,2*n)]
397397
x,y = R.gens()
398-
R0 = PolynomialRing(F,2*n+2,names = [str(x),str(y),"t"]+astr)
398+
R0 = PolynomialRing(F, 2 * n + 2, names=[str(x), str(y), "t"] + astr)
399399
vars0 = R0.gens()
400400
t = vars0[2]
401401
yt = y0*t**0+add([vars0[i]*t**(i-2) for i in range(3,2*n+2)])
@@ -1932,15 +1932,13 @@ def rational_points(self, algorithm="enum"):
19321932
return sorted(set(pnts))
19331933

19341934
elif algorithm == "all":
1935-
1936-
S_enum = self.rational_points(algorithm = "enum")
1937-
S_bn = self.rational_points(algorithm = "bn")
1935+
S_enum = self.rational_points(algorithm="enum")
1936+
S_bn = self.rational_points(algorithm="bn")
19381937
if S_enum != S_bn:
19391938
raise RuntimeError("Bug in rational_points -- different algorithms give different answers for curve %s!" % self)
19401939
return S_enum
1941-
19421940
else:
1943-
raise ValueError("No algorithm '%s' known"%algorithm)
1941+
raise ValueError("No algorithm '%s' known" % algorithm)
19441942

19451943

19461944
class IntegralAffineCurve(AffineCurve_field):

src/sage/schemes/curves/projective_curve.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ def local_coordinates(self, pt, n):
703703
y0 = F(pt[1])
704704
astr = ["a"+str(i) for i in range(1,2*n)]
705705
x,y = R.gens()
706-
R0 = PolynomialRing(F,2*n+2,names = [str(x),str(y),"t"]+astr)
706+
R0 = PolynomialRing(F, 2 * n + 2, names=[str(x), str(y), "t"] + astr)
707707
vars0 = R0.gens()
708708
t = vars0[2]
709709
yt = y0*t**0 + add([vars0[i]*t**(i-2) for i in range(3,2*n+2)])
@@ -2147,8 +2147,8 @@ def rational_points(self, algorithm="enum", sort=True):
21472147
if algorithm == "bn":
21482148
return self._points_via_singular(sort=sort)
21492149
elif algorithm == "all":
2150-
S_enum = self.rational_points(algorithm = "enum")
2151-
S_bn = self.rational_points(algorithm = "bn")
2150+
S_enum = self.rational_points(algorithm="enum")
2151+
S_bn = self.rational_points(algorithm="bn")
21522152
if S_enum != S_bn:
21532153
raise RuntimeError("Bug in rational_points -- different\
21542154
algorithms give different answers for\

src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx

+7-6
Original file line numberDiff line numberDiff line change
@@ -1045,10 +1045,10 @@ cdef int count(mpz_t c_mpz, mpz_t d_mpz, mpz_t *p_list, unsigned long p_list_len
10451045
return 0
10461046

10471047
def two_descent_by_two_isogeny(E,
1048-
int global_limit_small = 10,
1049-
int global_limit_large = 10000,
1050-
int verbosity = 0,
1051-
bint selmer_only = 0, bint proof = 1):
1048+
int global_limit_small=10,
1049+
int global_limit_large=10000,
1050+
int verbosity=0,
1051+
bint selmer_only=0, bint proof=1):
10521052
"""
10531053
Given an elliptic curve E with a two-isogeny phi : E --> E' and dual isogeny
10541054
phi', runs a two-isogeny descent on E, returning n1, n2, n1' and n2'. Here
@@ -1148,9 +1148,10 @@ def two_descent_by_two_isogeny(E,
11481148
return two_descent_by_two_isogeny_work(c, d,
11491149
global_limit_small, global_limit_large, verbosity, selmer_only, proof)
11501150

1151+
11511152
def two_descent_by_two_isogeny_work(Integer c, Integer d,
1152-
int global_limit_small = 10, int global_limit_large = 10000,
1153-
int verbosity = 0, bint selmer_only = 0, bint proof = 1):
1153+
int global_limit_small=10, int global_limit_large=10000,
1154+
int verbosity=0, bint selmer_only=0, bint proof=1):
11541155
"""
11551156
Do all the work in doing a two-isogeny descent.
11561157

src/sage/schemes/elliptic_curves/ell_rational_field.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ def _modular_symbol_normalize(self, sign, normalize, implementation, nap):
10951095
raise ValueError("Implementation should be one of 'sage', 'num' or 'eclib'")
10961096
return (sign, normalize, implementation, nap)
10971097

1098-
@cached_method(key = _modular_symbol_normalize)
1098+
@cached_method(key=_modular_symbol_normalize)
10991099
def modular_symbol(self, sign=+1, normalize=None, implementation='eclib', nap=0):
11001100
r"""
11011101
Return the modular symbol map associated to this elliptic curve
@@ -1964,7 +1964,7 @@ def three_selmer_rank(self, algorithm='UseSUnits'):
19641964
"""
19651965
from sage.interfaces.magma import magma
19661966
E = magma(self)
1967-
return Integer(E.ThreeSelmerGroup(MethodForFinalStep = magma('"%s"'%algorithm)).Ngens())
1967+
return Integer(E.ThreeSelmerGroup(MethodForFinalStep=magma('"%s"' % algorithm)).Ngens())
19681968

19691969
def rank(self, use_database=True, verbose=False,
19701970
only_use_mwrank=True,
@@ -2301,8 +2301,8 @@ def _compute_gens(self, proof,
23012301
if not only_use_mwrank:
23022302
try:
23032303
verbose_verbose("Trying to compute rank.")
2304-
r = self.rank(only_use_mwrank = False)
2305-
verbose_verbose("Got r = %s."%r)
2304+
r = self.rank(only_use_mwrank=False)
2305+
verbose_verbose("Got r = %s." % r)
23062306
if r == 0:
23072307
verbose_verbose("Rank = 0, so done.")
23082308
return [], True
@@ -2438,7 +2438,7 @@ def ngens(self, proof=None):
24382438
Generator 1 is [29604565304828237474403861024284371796799791624792913256602210:-256256267988926809388776834045513089648669153204356603464786949:490078023219787588959802933995928925096061616470779979261000]; height 95.98037...
24392439
Regulator = 95.980...
24402440
"""
2441-
return len(self.gens(proof = proof))
2441+
return len(self.gens(proof=proof))
24422442

24432443
def regulator(self, proof=None, precision=53, **kwds):
24442444
r"""
@@ -2646,7 +2646,7 @@ def saturation(self, points, verbose=False, max_prime=-1, min_prime=2):
26462646
from sage.libs.eclib.all import mwrank_MordellWeil
26472647
mw = mwrank_MordellWeil(c, verbose)
26482648
mw.process(v) # by default, this does no saturation yet
2649-
ok, index, unsat = mw.saturate(max_prime=max_prime, min_prime = min_prime)
2649+
ok, index, unsat = mw.saturate(max_prime=max_prime, min_prime=min_prime)
26502650
if not ok:
26512651
print("Failed to saturate failed at the primes {}".format(unsat))
26522652
sat = [Emin(P) for P in mw.points()]
@@ -6630,7 +6630,7 @@ def S_integral_x_coords_with_abs_bounded_by(abs_bound):
66306630
M = U.transpose()*M*U
66316631

66326632
# NB "lambda" is a reserved word in Python!
6633-
lamda = min(M.charpoly(algorithm="hessenberg").roots(multiplicities = False))
6633+
lamda = min(M.charpoly(algorithm="hessenberg").roots(multiplicities=False))
66346634
max_S = max(S)
66356635
len_S += 1 #Counting infinity (always "included" in S)
66366636
if verbose:

src/sage/schemes/elliptic_curves/heegner.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -3520,7 +3520,7 @@ def point_exact(self, prec=53, algorithm='lll', var='a', optimize=False):
35203520
M = K.extension(gg, names='b')
35213521
y = M.gen()/dd
35223522
x = M(x)
3523-
L = M.absolute_field(names = var)
3523+
L = M.absolute_field(names=var)
35243524
phi = L.structure()[1]
35253525
x = phi(x)
35263526
y = phi(y)
@@ -4364,13 +4364,9 @@ def mod(self, p, prec=53):
43644364

43654365
# do actual calculation
43664366
if self.conductor() == 1:
4367-
4368-
P = self._trace_exact_conductor_1(prec = prec)
4367+
P = self._trace_exact_conductor_1(prec=prec)
43694368
return E.change_ring(GF(p))(P)
4370-
4371-
else:
4372-
4373-
raise NotImplementedError
4369+
raise NotImplementedError
43744370

43754371
## def congruent_rational_point(self, n, prec=53):
43764372
## r"""

src/sage/schemes/elliptic_curves/height.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ def S(self, xi1, xi2, v):
12161216
([0.0781194447253472, 0.0823423732016403] U [0.917657626798360, 0.921880555274653])
12171217
"""
12181218
L = self.E.period_lattice(v)
1219-
w1, w2 = L.basis(prec = v.codomain().prec())
1219+
w1, w2 = L.basis(prec=v.codomain().prec())
12201220
beta = L.elliptic_exponential(w1/2)[0]
12211221
if xi2 < beta:
12221222
return UnionOfIntervals([])

src/sage/schemes/elliptic_curves/isogeny_class.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def graph(self):
403403
from sage.graphs.graph import Graph
404404

405405
if not self.E.base_field() is QQ:
406-
M = self.matrix(fill = False)
406+
M = self.matrix(fill=False)
407407
n = len(self)
408408
G = Graph(M, format='weighted_adjacency_matrix')
409409
D = dict([(v,self.curves[v]) for v in G.vertices(sort=False)])
@@ -416,11 +416,10 @@ def graph(self):
416416
G.relabel(list(range(1, n + 1)))
417417
return G
418418

419-
420-
M = self.matrix(fill = False)
419+
M = self.matrix(fill=False)
421420
n = M.nrows() # = M.ncols()
422421
G = Graph(M, format='weighted_adjacency_matrix')
423-
N = self.matrix(fill = True)
422+
N = self.matrix(fill=True)
424423
D = dict([(v,self.curves[v]) for v in G.vertices(sort=False)])
425424
# The maximum degree classifies the shape of the isogeny
426425
# graph, though the number of vertices is often enough.
@@ -535,7 +534,8 @@ def reorder(self, order):
535534
return self
536535
if isinstance(order, str):
537536
if order == "lmfdb":
538-
reordered_curves = sorted(self.curves, key = lambda E: E.a_invariants())
537+
reordered_curves = sorted(self.curves,
538+
key=lambda E: E.a_invariants())
539539
else:
540540
reordered_curves = list(self.E.isogeny_class(algorithm=order))
541541
elif isinstance(order, (list, tuple, IsogenyClass_EC)):
@@ -1068,7 +1068,8 @@ def _compute(self):
10681068
raise RuntimeError("unable to find %s in the database" % self.E)
10691069
# All curves will have the same conductor and isogeny class,
10701070
# and there are most 8 of them, so lexicographic sorting is okay.
1071-
self.curves = tuple(sorted(curves, key = lambda E: E.cremona_label()))
1071+
self.curves = tuple(sorted(curves,
1072+
key=lambda E: E.cremona_label()))
10721073
self._mat = None
10731074
elif algorithm == "sage":
10741075
curves = [self.E.minimal_model()]

src/sage/schemes/elliptic_curves/mod_sym_num.pyx

+8-11
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ cdef class ModularSymbolNumerical:
970970
ans = self._evaluate_approx(ra, eps)
971971

972972
if prec > self._om1.parent().prec():
973-
L = self._E.period_lattice().basis(prec = prec)
973+
L = self._E.period_lattice().basis(prec=prec)
974974
self._om1 = L[0]
975975
self._om2 = L[1].imag()
976976
cinf = self._E.real_components()
@@ -2156,10 +2156,8 @@ cdef class ModularSymbolNumerical:
21562156
ans = su
21572157
return CC(ans)
21582158

2159-
2160-
21612159
def _from_r_to_rr_approx(self, Rational r, Rational rr, double eps,
2162-
method = None, int use_partials=2):
2160+
method=None, int use_partials=2):
21632161
r"""
21642162
Given a cusp `r` this computes the integral `\lambda(r\to r')`
21652163
from `r` to `r'` to the given precision ``eps``.
@@ -2313,7 +2311,7 @@ cdef class ModularSymbolNumerical:
23132311

23142312
if method == "indirect" or method == "both":
23152313
verbose(" using the indirect integration from %s to %s "
2316-
"with %s terms to sum"%(r, rr, T1+T2), level =2)
2314+
"with %s terms to sum"%(r, rr, T1+T2), level=2)
23172315
#self.nc_indirect += 1
23182316
ans2 = ( self._from_ioo_to_r_approx(r, eps/2,
23192317
use_partials=use_partials)
@@ -2474,7 +2472,7 @@ cdef class ModularSymbolNumerical:
24742472

24752473
# (key=lambda r,sign,use_partials:(r,sign)) lead to a compiler crash
24762474
@cached_method
2477-
def _value_ioo_to_r(self, Rational r, int sign = 0,
2475+
def _value_ioo_to_r(self, Rational r, int sign=0,
24782476
int use_partials=2):
24792477
r"""
24802478
Return `[r]^+` or `[r]^-` for a rational `r`.
@@ -2532,7 +2530,7 @@ cdef class ModularSymbolNumerical:
25322530
return self._round(lap, sign, True)
25332531

25342532
@cached_method
2535-
def _value_r_to_rr(self, Rational r, Rational rr, int sign = 0,
2533+
def _value_r_to_rr(self, Rational r, Rational rr, int sign=0,
25362534
int use_partials=2):
25372535
r"""
25382536
Return the rational number `[r']^+ - [r]^+`. However the
@@ -2603,7 +2601,7 @@ cdef class ModularSymbolNumerical:
26032601
return self._round(lap, sign, True)
26042602

26052603
@cached_method
2606-
def transportable_symbol(self, Rational r, Rational rr, int sign = 0):
2604+
def transportable_symbol(self, Rational r, Rational rr, int sign=0):
26072605
r"""
26082606
Return the symbol `[r']^+ - [r]^+` where `r'=\gamma(r)` for some
26092607
`\gamma\in\Gamma_0(N)`. These symbols can be computed by transporting
@@ -2860,8 +2858,7 @@ cdef class ModularSymbolNumerical:
28602858
res -= self._value_ioo_to_r(rr,sign, use_partials=2)
28612859
return res
28622860

2863-
2864-
def manin_symbol(self, llong u, llong v, int sign = 0):
2861+
def manin_symbol(self, llong u, llong v, int sign=0):
28652862
r"""
28662863
Given a pair `(u,v)` presenting a point in
28672864
`\mathbb{P}^1(\mathbb{Z}/N\mathbb{Z})` and hence a coset of
@@ -3755,7 +3752,7 @@ def _test_against_table(range_of_conductors, other_implementation="sage", list_o
37553752
Mr = M(r)
37563753
M2r = M(r, sign=-1)
37573754
if verb:
3758-
print("r={} : ({},{}),({}, {})".format(r,mr,m2r,Mr,M2r), end= " ", flush=True)
3755+
print("r={} : ({},{}),({}, {})".format(r,mr,m2r,Mr,M2r), end=" ", flush=True)
37593756
if mr != Mr or m2r != M2r:
37603757
print (("B u g : curve = {}, cusp = {}, sage's symbols"
37613758
+ "({},{}), our symbols ({}, {})").format(C.label(), r,

src/sage/schemes/elliptic_curves/padic_lseries.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class pAdicLseries(SageObject):
143143
sage: lp == loads(dumps(lp))
144144
True
145145
"""
146-
def __init__(self, E, p, implementation = 'eclib', normalize='L_ratio'):
146+
def __init__(self, E, p, implementation='eclib', normalize='L_ratio'):
147147
r"""
148148
INPUT:
149149
@@ -337,7 +337,7 @@ def modular_symbol(self, r, sign=+1, quadratic_twist=+1):
337337
return -sum([kronecker_symbol(D, u) * m(r + ZZ(u) / D)
338338
for u in range(1, -D)])
339339

340-
def measure(self, a, n, prec, quadratic_twist=+1, sign = +1):
340+
def measure(self, a, n, prec, quadratic_twist=+1, sign=+1):
341341
r"""
342342
Return the measure on `\ZZ_p^{\times}` defined by
343343
@@ -1550,9 +1550,9 @@ def __phi_bpr(self, prec=0):
15501550
print("Warning: Very large value for the precision.")
15511551
if prec == 0:
15521552
prec = floor((log(10000)/log(p)))
1553-
verbose("prec set to %s"%prec)
1553+
verbose("prec set to %s" % prec)
15541554
eh = E.formal()
1555-
om = eh.differential(prec = p**prec+3)
1555+
om = eh.differential(prec=p**prec+3)
15561556
verbose("differential computed")
15571557
xt = eh.x(prec=p**prec + 3)
15581558
et = xt*om

src/sage/schemes/elliptic_curves/padics.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def _normalize_padic_lseries(self, p, normalize, implementation, precision):
9898
raise ValueError("Implementation should be one of 'sage', 'eclib', 'num' or 'pollackstevens'")
9999
return (p, normalize, implementation, precision)
100100

101+
101102
@cached_method(key=_normalize_padic_lseries)
102-
def padic_lseries(self, p, normalize = None, implementation = 'eclib', precision = None):
103+
def padic_lseries(self, p, normalize=None, implementation='eclib',
104+
precision=None):
103105
r"""
104106
Return the `p`-adic `L`-series of self at
105107
`p`, which is an object whose approx method computes
@@ -209,16 +211,16 @@ def padic_lseries(self, p, normalize = None, implementation = 'eclib', precision
209211
if implementation in ['sage', 'eclib', 'num']:
210212
if self.ap(p) % p != 0:
211213
Lp = plseries.pAdicLseriesOrdinary(self, p,
212-
normalize = normalize, implementation = implementation)
214+
normalize=normalize, implementation=implementation)
213215
else:
214216
Lp = plseries.pAdicLseriesSupersingular(self, p,
215-
normalize = normalize, implementation = implementation)
217+
normalize=normalize, implementation=implementation)
216218
else:
217219
phi = self.pollack_stevens_modular_symbol(sign=0)
218220
if phi.parent().level() % p == 0:
219-
Phi = phi.lift(p, precision, eigensymbol = True)
221+
Phi = phi.lift(p, precision, eigensymbol=True)
220222
else:
221-
Phi = phi.p_stabilize_and_lift(p, precision, eigensymbol = True)
223+
Phi = phi.p_stabilize_and_lift(p, precision, eigensymbol=True)
222224
Lp = Phi.padic_lseries() #mm TODO should this pass precision on too ?
223225
Lp._cinf = self.real_components()
224226
return Lp

src/sage/schemes/elliptic_curves/period_lattice.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def is_rectangular(self):
802802
return self.real_flag == +1
803803
raise RuntimeError("Not defined for non-real lattices.")
804804

805-
def real_period(self, prec = None, algorithm='sage'):
805+
def real_period(self, prec=None, algorithm='sage'):
806806
"""
807807
Return the real period of this period lattice.
808808
@@ -840,8 +840,9 @@ def real_period(self, prec = None, algorithm='sage'):
840840
return self.basis(prec,algorithm)[0]
841841
raise RuntimeError("Not defined for non-real lattices.")
842842

843-
def omega(self, prec = None, bsd_normalise = False):
844-
r"""Return the real or complex volume of this period lattice.
843+
def omega(self, prec=None, bsd_normalise=False):
844+
r"""
845+
Return the real or complex volume of this period lattice.
845846
846847
INPUT:
847848
@@ -1014,7 +1015,7 @@ def complex_area(self, prec=None):
10141015
w1,w2 = self.basis(prec)
10151016
return (w1*w2.conjugate()).imag().abs()
10161017

1017-
def sigma(self, z, prec = None, flag=0):
1018+
def sigma(self, z, prec=None, flag=0):
10181019
r"""
10191020
Return the value of the Weierstrass sigma function for this elliptic curve period lattice.
10201021

0 commit comments

Comments
 (0)