Skip to content

Commit

Permalink
Merge pull request LMFDB#5679 from fchapoton/less_parentheses
Browse files Browse the repository at this point in the history
use ruff to remove superfluous parentheses
  • Loading branch information
roed314 authored Oct 9, 2023
2 parents 6ae6891 + e632ada commit cbe5948
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lmfdb/characters/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ def validate_label(label):
elif re.match(r'^\d+\.[a-z]+\.\d+$', label): # label has both orbit and number
return True
else:
raise ValueError(("It must be of the form modulus.number, or "
raise ValueError("It must be of the form modulus.number, or "
"modulus.letter, or modulus.letter.number, "
"with modulus and number positive natural numbers "
" and letter an alphabetic letter."
))
)

def jump(info):
jump_box = info["jump"].strip() # only called when this present
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/lfunctions/Lfunctionutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def lfuncEPtex(L, fmt):
fmt could be any of the values: "abstract"
"""
from .Lfunction import Lfunction_from_db
if ((L.Ltype() in ["genus2curveQ"] or isinstance(L, Lfunction_from_db))) and fmt == "arithmetic":
if (L.Ltype() in ["genus2curveQ"] or isinstance(L, Lfunction_from_db)) and fmt == "arithmetic":
try:
return lfuncEPhtml(L, fmt)
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/nfutils/psort.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def prime_from_label(K, lab):
make_keys(K,p)
d = K.psort_dict[p]
try:
return next((P for P in d if d[P][:2]==(n,j)))
return next(P for P in d if d[P][:2]==(n,j))
except StopIteration:
return 0

Expand Down
4 changes: 2 additions & 2 deletions lmfdb/siegel_modular_forms/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ def export(collection, name):

# Fourier coefficients and eigenvalues
fcs = db.smf_fc.search({'owner_id': id_link}, ['det', 'data'])
doc['Fourier_coefficients'] = dict(((fc['det'], fc['data']) for fc in fcs))
doc['Fourier_coefficients'] = dict((fc['det'], fc['data']) for fc in fcs)

evs = db.smf_ev.search({'owner_id': id_link}, ['index', 'data'])
doc['eigenvalues'] = dict(((ev['index'], ev['data']) for ev in evs))
doc['eigenvalues'] = dict((ev['index'], ev['data']) for ev in evs)

label = doc['collection'][0] + '.' + doc['name']
doc['label']= label
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/zeros/zeta/zetazeros.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def list_zeros(N=None,
zeros = zeros_starting_at_t(t, limit)

if fmt == 'plain':
response = Response(("%d %s\n" % (n, nstr(z,31+floor(log(z,10))+1,strip_zeros=False,min_fixed=-inf,max_fixed=+inf)) for (n, z) in zeros))
response = Response("%d %s\n" % (n, nstr(z,31+floor(log(z,10))+1,strip_zeros=False,min_fixed=-inf,max_fixed=+inf)) for (n, z) in zeros)
response.headers['content-type'] = 'text/plain'
if download == "yes":
response.headers['content-disposition'] = 'attachment; filename=zetazeros'
Expand Down
6 changes: 3 additions & 3 deletions scripts/siegel_modular_forms/Yoshida_Lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def Yoshida_Lift(F, hhecke_evals, hlevel, hweight=[2, 2], primeprec=100):
lam[p] = 0
mu[p] = p**(2*(weight -3))*(-p**2 - p*hhecke_evals[F.prime_above(p)] - 1)
else:
lam[p] = p**((weight - 3))*p*(hhecke_evals[F.primes_above(p)[0]] + hhecke_evals[F.primes_above(p)[1]])
lam[p] = p**(weight - 3)*p*(hhecke_evals[F.primes_above(p)[0]] + hhecke_evals[F.primes_above(p)[1]])
mu[p] = p**(2*(weight - 3))*(p**2 + p*hhecke_evals[F.primes_above(p)[0]]*hhecke_evals[F.primes_above(p)[1]] - 1)
if v == 1:
if hlevel.valuation(F.primes_above(p)[0]) == 1:
Expand All @@ -36,11 +36,11 @@ def Yoshida_Lift(F, hhecke_evals, hlevel, hweight=[2, 2], primeprec=100):
else:
pt = F.primes_above(p)[0]
po = F.primes_above(p)[1]
lam[p] = p**((weight - 3))*(p*hhecke_evals[po] + (p + 1)*hhecke_evals[pt])
lam[p] = p**(weight - 3)*(p*hhecke_evals[po] + (p + 1)*hhecke_evals[pt])
mu[p] = p**(2*(weight - 3))*(p*hhecke_evals[F.primes_above(p)[0]]*hhecke_evals[F.primes_above(p)[1]])
else:
if len(F.primes_above(p)) == 2:
lam[p] = p**((weight - 3))*p*(hhecke_evals[F.primes_above(p)[0]] + hhecke_evals[F.primes_above(p)[1]])
lam[p] = p**(weight - 3)*p*(hhecke_evals[F.primes_above(p)[0]] + hhecke_evals[F.primes_above(p)[1]])
if hlevel.valuation(F.primes_above(p)[0])*hlevel.valuation(F.primes_above(p)[1]) == 0:
mu[p] = 0
else:
Expand Down

0 comments on commit cbe5948

Please sign in to comment.