Skip to content

Commit

Permalink
Merge pull request #6205 from LMFDB/main
Browse files Browse the repository at this point in the history
main -> web
  • Loading branch information
AndrewVSutherland authored Oct 14, 2024
2 parents b8fd820 + 6566615 commit fcf09e3
Show file tree
Hide file tree
Showing 86 changed files with 1,028 additions and 960 deletions.
10 changes: 5 additions & 5 deletions lmfdb/abvar/fq/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ class AbvarFq_download(Downloader):
def download_all(self, label, lang='text'):
data = db.av_fq_isog.lookup(label)
if data is None:
return abort(404, "Label not found: %s"%label)
return abort(404, "Label not found: %s" % label)
return self._wrap(Json.dumps(data),
label,
lang=lang,
title='Stored data for abelian variety isogeny class %s,'%(label))
title='Stored data for abelian variety isogeny class %s,' % (label))

def download_curves(self, label, lang='text'):
data = db.av_fq_isog.lookup(label)
if data is None:
return abort(404, "Label not found: %s"%label)
return abort(404, "Label not found: %s" % label)
if 'curves' not in data or ('curves' in data and not data['curves']):
return abort(404, "No curves for abelian variety isogeny class %s"%label)
return abort(404, "No curves for abelian variety isogeny class %s" % label)
return self._wrap('\n'.join(data['curves']),
label + '.curves',
lang=lang,
title='Curves in abelian variety isogeny class %s,'%(label))
title='Curves in abelian variety isogeny class %s,' % (label))

def postprocess(self, rec, info, query):
return AbvarFq_isoclass(rec)
33 changes: 13 additions & 20 deletions lmfdb/abvar/fq/isog_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from lmfdb.app import app

from sage.rings.all import Integer, QQ, RR, ZZ
from sage.plot.all import line, points, circle, Graphics
from sage.plot.all import line, points, circle, polygon, Graphics
from sage.misc import latex
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_attribute import lazy_attribute
Expand Down Expand Up @@ -165,25 +165,18 @@ def newton_plot(self):
y += c * s
pts.append((x, y))
L = Graphics()
L += line([(0, 0), (0, y + 0.2)], color="grey")
for i in range(1, y + 1):
L += line([(0, i), (0.06, i)], color="grey")
for i in range(1, C[0]):
L += line([(i, 0), (i, 0.06)], color="grey")
for i in range(len(pts) - 1):
P = pts[i]
Q = pts[i + 1]
for x in range(P[0], Q[0] + 1):
L += line(
[(x, P[1]), (x, P[1] + (x - P[0]) * (Q[1] - P[1]) / (Q[0] - P[0]))],
color="grey",
)
for y in range(P[1], Q[1]):
L += line(
[(P[0] + (y - P[1]) * (Q[0] - P[0]) / (Q[1] - P[1]), y), (Q[0], y)],
color="grey",
)
L += line(pts, thickness=2)
xmax = len(S)
ymax = ZZ(len(S)/2)
pts.append((xmax,0))
L += polygon(pts,alpha=0.1)
pts.remove((xmax,0))
for i in range(xmax+1):
L += line([(i, 0), (i, ymax)], color="grey", thickness=0.5)
for j in range(ymax+1):
L += line([(0, j), (xmax, j)], color="grey", thickness=0.5)
L+=line(pts,thickness=2)
for v in pts:
L += circle(v, 0.06, fill=True)
L.axes(False)
L.set_aspect_ratio(1)
return encode_plot(L, pad=0, pad_inches=0, bbox_inches="tight")
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/abvar/fq/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ def abelian_varieties_by_gqi(g, q, iso):
properties=cl.properties(),
friends=cl.friends(),
downloads=downloads,
title='Abelian variety isogeny class %s over $%s$'%(label, cl.field()),
title='Abelian variety isogeny class %s over $%s$' % (label, cl.field()),
bread=bread,
cl=cl,
learnmore=learnmore_list(),
KNOWL_ID='av.fq.%s'%label
KNOWL_ID='av.fq.%s' % label
)

def url_for_label(label):
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def full_index():
def stats():
def mb(x):
return int(round(x/2**20.))
info={}
info = {}
info['minsizes'] = ['0','1','10','100','1000','10000','100000']
info['minsize'] = request.args.get('minsize','1').strip()
if info['minsize'] not in info['minsizes']:
Expand Down Expand Up @@ -270,7 +270,7 @@ def apierror(msg, flash_extras=[], code=404, table=True):

# executing the query "q" and replacing the _id in the result list
# So as not to preserve backwards compatibility (see test_api_usage() test)
if table=='ec_curvedata':
if table == 'ec_curvedata':
for oldkey, newkey in zip(['label', 'iso', 'number'], ['Clabel', 'Ciso', 'Cnumber']):
if oldkey in q:
q[newkey] = q[oldkey]
Expand Down
6 changes: 3 additions & 3 deletions lmfdb/api2/api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def handle_singletons(path_var):

@api2_page.route("/description/searchers")
def list_searchers():
names=[]
h_names=[]
descs=[]
names = []
h_names = []
descs = []
for el in searchers:
names.append(el)
h_names.append(searchers[el].get_name())
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/api2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def create_search_dict(table='', query=None, view_start=0, request=None):
'max_count':100, 'correct_count':False, 'count_only':False}

if request:
search['view_start']=int(request.args.get('_view_start', search['view_start']))
search['view_start'] = int(request.args.get('_view_start', search['view_start']))
search['max_count'] = min(int(request.args.get('_max_count', search['max_count'])), 100)
search['correct_count'] = bool(request.args.get('_correct_count', search['correct_count']))
search['count_only'] = bool(request.args.get('_count_only', search['count_only']))
Expand Down
16 changes: 8 additions & 8 deletions lmfdb/artin_representations/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def artin_representation_jump(info):
return redirect(url_for(".index"))
return redirect(url_for(".render_artin_representation_webpage", label=label), 307)

dihedrals =[ [4,2], [6,1], [8, 3], [10,1], [12,4], [14,1], [16,7],
dihedrals = [ [4,2], [6,1], [8, 3], [10,1], [12,4], [14,1], [16,7],
[ 18, 1 ], [ 20, 4 ], [ 22, 1 ], [ 24, 6 ], [ 26, 1 ], [ 28, 3 ], [ 30, 3 ],
[ 32, 18 ], [ 34, 1 ], [ 36, 4 ], [ 38, 1 ], [ 40, 6 ], [ 42, 5 ], [ 44, 3 ],
[ 46, 1 ], [ 48, 7 ], [ 50, 1 ], [ 52, 4 ], [ 54, 1 ], [ 56, 5 ], [ 58, 1 ],
Expand Down Expand Up @@ -183,9 +183,9 @@ def parse_projective_group(inp, query, qfield):
query[qfield] = [24,12]
elif Dn_RE.match(inp):
n = int(inp.replace('d',''))-2
if n>=0 and n<len(dihedrals):
if n >= 0 and n < len(dihedrals):
query[qfield] = dihedrals[n]
elif n>=0:
elif n >= 0:
query[qfield] = [-1,-2] # we don't have it
else:
try:
Expand Down Expand Up @@ -339,7 +339,7 @@ def render_artin_representation_webpage(label):

#artin_logger.info("Found %s" % (the_rep._data))

if case=='rep':
if case == 'rep':
title = "Artin representation %s" % label
else:
title = "Galois orbit of Artin representations %s" % label
Expand Down Expand Up @@ -369,10 +369,10 @@ def render_artin_representation_webpage(label):
if proj_coefs != the_nf.polynomial():
friends.append(("Field {}".format(proj_wnf.get_label()),
str(url_for("number_fields.by_label", label=proj_wnf.get_label()))))
if case == 'rep' or the_rep.galois_conjugacy_size()==1:
if case == 'rep' or the_rep.galois_conjugacy_size() == 1:
cc = the_rep.central_character()
if cc is not None:
if the_rep.dimension()==1:
if the_rep.dimension() == 1:
if cc.order == 2:
cc_name = cc.symbol
else:
Expand All @@ -391,7 +391,7 @@ def render_artin_representation_webpage(label):
friends.append(("L-function", url_for('l_functions.by_full_label', label='1-1-1.1-r0-0-0')))
else:
# looking for Lhash dirichlet_L_modulus.number
mylhash = 'dirichlet_L_%d.%d'%(cc.modulus,cc.number)
mylhash = 'dirichlet_L_%d.%d' % (cc.modulus,cc.number)
lres = db.lfunc_instances.lucky({'Lhash': mylhash})
if lres is not None:
friends.append(("L-function", url_for('l_functions.by_full_label', label=lres["label"])))
Expand All @@ -410,7 +410,7 @@ def render_artin_representation_webpage(label):
friends.append(("Artin representation " + artin_label_pretty(newlabel),
url_for(".render_artin_representation_webpage", label=newlabel)))

info={} # for testing
info = {} # for testing

if case == 'rep':
return render_template(
Expand Down
24 changes: 12 additions & 12 deletions lmfdb/bianchi_modular_forms/bianchi_modular_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def statistics():
def bianchi_modular_form_jump(info):
label = info['jump'].strip()
dat = label.split("-")
if len(dat)==2: # assume field & level, display space
if len(dat) == 2: # assume field & level, display space
return render_bmf_space_webpage(dat[0], dat[1])
else: # assume single newform label; will display an error if invalid
return bianchi_modular_form_by_label(label)
Expand Down Expand Up @@ -184,7 +184,7 @@ def bianchi_modular_form_search(info, query):
query['CM'] = 0 # will exclude NULL values
elif info['include_cm'] == 'only':
query['CM'] = {'$ne': 0} # will exclude NULL values
if info.get('include_base_change') =='exclude':
if info.get('include_base_change') == 'exclude':
query['bc'] = 0
elif info.get('include_base_change') == 'only':
query['bc'] = {'$ne': 0}
Expand Down Expand Up @@ -223,13 +223,13 @@ def bmf_field_dim_table(**args):
argsdict.update(to_dict(request.args))
gl_or_sl = argsdict['gl_or_sl']

field_label=argsdict['field_label']
field_label = argsdict['field_label']
field_label = nf_string_to_label(field_label)

count = parse_count(argsdict, 50)
start = parse_start(argsdict)

info={}
info = {}
info['gl_or_sl'] = gl_or_sl
# level_flag controls whether to list all levels ('all'), only
# those with positive cuspidal dimension ('cusp'), or only those
Expand All @@ -245,7 +245,7 @@ def bmf_field_dim_table(**args):
parse_ints(argsdict, query, 'level_norm')
info["level_norm"] = argsdict["level_norm"]
query['field_label'] = field_label
if gl_or_sl=='gl2_dims':
if gl_or_sl == 'gl2_dims':
info['group'] = 'GL(2)'
info['bgroup'] = r'\GL(2,\mathcal{O}_K)'
else:
Expand Down Expand Up @@ -296,7 +296,7 @@ def bmf_field_dim_table(**args):
info['nlevels'] = len(data)
dimtable = [{'level_label': dat['level_label'],
'level_norm': dat['level_norm'],
'level_space': url_for(".render_bmf_space_webpage", field_label=field_label, level_label=dat['level_label']) if gl_or_sl=='gl2_dims' else "",
'level_space': url_for(".render_bmf_space_webpage", field_label=field_label, level_label=dat['level_label']) if gl_or_sl == 'gl2_dims' else "",
'dims': dims[dat['level_label']]} for dat in data]
info['dimtable'] = dimtable
return render_template("bmf-field_dim_table.html", info=info, title=t, properties=properties, bread=bread)
Expand Down Expand Up @@ -334,7 +334,7 @@ def render_bmf_space_webpage(field_label, level_label):
info['level_norm'] = data['level_norm']
info['field_poly'] = teXify_pol(str(nf.poly()))
info['field_knowl'] = nf_display_knowl(field_label, pretty_field_label)
w = 'i' if nf.disc()==-4 else 'a'
w = 'i' if nf.disc() == -4 else 'a'
L = nf.K().change_names(w)
alpha = L.gen()
info['field_gen'] = latex(alpha)
Expand All @@ -345,7 +345,7 @@ def render_bmf_space_webpage(field_label, level_label):
weights = list(dim_data)
weights.sort(key=int)
for w in weights:
dim_data[w]['dim']=dim_data[w]['cuspidal_dim']
dim_data[w]['dim'] = dim_data[w]['cuspidal_dim']
info['dim_data'] = dim_data
info['weights'] = weights
info['nweights'] = len(weights)
Expand All @@ -357,14 +357,14 @@ def render_bmf_space_webpage(field_label, level_label):
'url': url_for(".render_bmf_webpage",field_label=f['field_label'], level_label=f['level_label'], label_suffix=f['label_suffix']),
'wt': f['weight'],
'dim': f['dimension'],
'sfe': "+1" if f.get('sfe',None)==1 else "-1" if f.get('sfe',None)==-1 else "?",
'sfe': "+1" if f.get('sfe',None) == 1 else "-1" if f.get('sfe',None) == -1 else "?",
'bc': bc_info(f['bc']),
'cm': cm_info(f.get('CM','?')),
} for f in newforms]
info['nnewforms'] = len(info['nfdata'])
# currently we have newforms of dimension 1 and 2 only (mostly dimension 1)
# but the dimension 2 data is untrustworthy so is ignored here
info['nnf1'] = sum(1 for f in info['nfdata'] if f['dim']==1)
info['nnf1'] = sum(1 for f in info['nfdata'] if f['dim'] == 1)
#info['nnf2'] = sum(1 for f in info['nfdata'] if f['dim']==2)
info['nnf_missing'] = dim_data['2']['new_dim'] - info['nnf1'] # - 2*info['nnf2']
properties = [('Base field', pretty_field_label), ('Level',info['level_label']), ('Norm',str(info['level_norm'])), ('New dimension',str(newdim))]
Expand Down Expand Up @@ -447,7 +447,7 @@ def download_bmf_magma(**args):
outstr += 'heckePol := x;\nK := Rationals(); e := 1;\n'

hecke_eigs_processed = [str(st).replace(' ', '') if st != 'not known' else '"not known"' for st in hecke_eigs]
outstr += '\nheckeEigenvaluesList := [*\n'+ ',\n'.join(hecke_eigs_processed) + '\n*];\n'
outstr += '\nheckeEigenvaluesList := [*\n' + ',\n'.join(hecke_eigs_processed) + '\n*];\n'
outstr += '\nheckeEigenvalues := AssociativeArray();\n'
outstr += 'for i in [1..#heckeEigenvaluesList] do\n heckeEigenvalues[primes[i]] := heckeEigenvaluesList[i];\nend for;\n'

Expand Down Expand Up @@ -635,7 +635,7 @@ def render_bmf_webpage(field_label, level_label, label_suffix):
friends=friends,
info=info,
learnmore=learnmore_list(),
KNOWL_ID="mf.bianchi.%s"%label,
KNOWL_ID="mf.bianchi.%s" % label,
)


Expand Down
12 changes: 6 additions & 6 deletions lmfdb/bianchi_modular_forms/web_BMF.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def make_form(self,nap0=50):
# 'hecke_poly_obj' is the non-LaTeX version of hecke_poly
self.hecke_poly_obj = self.hecke_poly

if self.dimension>1:
if self.dimension > 1:
Qx = PolynomialRing(QQ,'x')
self.hecke_poly = Qx(str(self.hecke_poly))
F = NumberField(self.hecke_poly,'z')
Expand All @@ -176,7 +176,7 @@ def conv(ap):
ideal_label(p),
web_latex(p.gens_reduced()),
web_latex(ap)] for p,ap in zip(primes_iter(K), self.hecke_eigs[:self.neigs]) if p not in badp]
self.have_AL = self.AL_eigs[0]!='?'
self.have_AL = self.AL_eigs[0] != '?'
if self.have_AL:
self.AL_table = [[web_latex(p.norm()),
ideal_label(p),
Expand All @@ -199,7 +199,7 @@ def conv(ap):
self.anrank = "not determined"
else:
self.Lratio = QQ(self.Lratio)
self.anrank = r"\(0\)" if self.Lratio!=0 else "odd" if self.sfe==-1 else r"\(\ge2\), even"
self.anrank = r"\(0\)" if self.Lratio != 0 else "odd" if self.sfe == -1 else r"\(\ge2\), even"

self.properties = [('Label', self.label),
('Base field', pretty_field),
Expand All @@ -215,7 +215,7 @@ def conv(ap):
elif self.CM == 0:
self.CM = 'no'
else:
if int(self.CM)%4 in [2,3]:
if int(self.CM) % 4 in [2,3]:
self.CM = 4*int(self.CM)
self.CM = "$%s$" % self.CM
except AttributeError:
Expand All @@ -224,15 +224,15 @@ def conv(ap):

self.bc_extra = ''
self.bcd = 0
self.bct = self.bc!='?' and self.bc!=0
self.bct = self.bc != '?' and self.bc != 0
if self.bc == '?':
self.bc = 'not determined'
elif self.bc == 0:
self.bc = 'no'
elif self.bc == 1:
self.bcd = self.bc
self.bc = 'yes'
elif self.bc >1:
elif self.bc > 1:
self.bcd = self.bc
self.bc = 'yes'
self.bc_extra = r', of a form over \(\mathbb{Q}\) with coefficients in \(\mathbb{Q}(\sqrt{' + str(self.bcd) + r'})\)'
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/characters/HeckeCharacters.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __call__(self, x):
return HeckeChar(self, x)

def __repr__(self):
return "Group of Hecke characters on %s"%self.group()
return "Group of Hecke characters on %s" % self.group()

#def list(self):
# return [ HeckeChar(self, c.list()) for c in DualAbelianGroup_class.list(self) ]
Expand Down Expand Up @@ -147,7 +147,7 @@ def logvalue(self, x):
if isinstance(r, (int,Integer)):
return 0
n,d = r.numerator(), r.denominator()
return n%d/d
return n % d/d

def logvalues_on_gens(self):
F = self.exponents()
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/characters/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def render_Dirichletwebpage(modulus=None, orbit_label=None, number=None):
modulus, number = modulus.split('.')
return redirect(url_for(".render_Dirichletwebpage", modulus=modulus, number=number), 301)
if number is not None and number > modulus:
return redirect(url_for(".render_Dirichletwebpage", modulus=modulus, number=number%modulus), 301)
return redirect(url_for(".render_Dirichletwebpage", modulus=modulus, number=number % modulus), 301)
if modulus == 1 and number == 0:
return redirect(url_for(".render_Dirichletwebpage", modulus=1, number=1), 301)

Expand Down Expand Up @@ -467,7 +467,7 @@ def render_Dirichletwebpage(modulus=None, orbit_label=None, number=None):
return redirect(url_for(".render_DirichletNavigation"))
else:
if gcd(modulus,number) != 1:
flash_error("%s is not a valid Conrey label (number must be coprime to modulus).", "%s.%s"%(args['modulus'],args['number']))
flash_error("%s is not a valid Conrey label (number must be coprime to modulus).", "%s.%s" % (args['modulus'],args['number']))
return redirect(url_for(".render_DirichletNavigation"))

try:
Expand Down
Loading

0 comments on commit fcf09e3

Please sign in to comment.