diff --git a/lmfdb/abvar/fq/main.py b/lmfdb/abvar/fq/main.py index f665cc12cf..8acd564b5f 100644 --- a/lmfdb/abvar/fq/main.py +++ b/lmfdb/abvar/fq/main.py @@ -616,7 +616,7 @@ def jump(info): if deg % 2 == 1: raise ValueError except Exception: - flash_error ("%s is not valid input. Expected a label or Weil polynomial.", jump_box) + flash_error("%s is not valid input. Expected a label or Weil polynomial.", jump_box) return redirect(url_for(".abelian_varieties")) g = deg//2 lead = cdict[deg] @@ -624,7 +624,7 @@ def jump(info): lead = cdict[0] cdict = {deg-exp: coeff for (exp, coeff) in cdict.items()} if cdict.get(0) != 1: - flash_error ("%s is not valid input. Polynomial must have constant or leading coefficient 1", jump_box) + flash_error("%s is not valid input. Polynomial must have constant or leading coefficient 1", jump_box) return redirect(url_for(".abelian_varieties")) try: q = lead.nth_root(g) @@ -634,7 +634,7 @@ def jump(info): if cdict.get(2*g-i, 0) != q**(g-i) * cdict.get(i, 0): raise ValueError except ValueError: - flash_error ("%s is not valid input. Expected a label or Weil polynomial.", jump_box) + flash_error("%s is not valid input. Expected a label or Weil polynomial.", jump_box) return redirect(url_for(".abelian_varieties")) def extended_code(c): diff --git a/lmfdb/characters/web_character.py b/lmfdb/characters/web_character.py index f8048cd972..2ef7c11080 100644 --- a/lmfdb/characters/web_character.py +++ b/lmfdb/characters/web_character.py @@ -339,13 +339,13 @@ def jacobi_sum(self, val): try: val = int(val) except ValueError: - raise Warning ("n must be a positive integer coprime to the modulus {} and no greater than it".format(mod)) + raise Warning("n must be a positive integer coprime to the modulus {} and no greater than it".format(mod)) if gcd(mod, val) > 1: - raise Warning ("n must be coprime to the modulus : %s" % mod) + raise Warning("n must be coprime to the modulus : %s" % mod) if val > mod: - raise Warning ("n must be less than the modulus : %s" % mod) + raise Warning("n must be less than the modulus : %s" % mod) if val < 0: - raise Warning ("n must be positive") + raise Warning("n must be positive") chi_valuepairs = [[k, chi.conreyangle(k) * chi.order] for k in self.gens] chi_genvalues = [int(v) for g, v in chi_valuepairs] diff --git a/lmfdb/classical_modular_forms/main.py b/lmfdb/classical_modular_forms/main.py index dd4fcb1aed..4bc5266b9d 100644 --- a/lmfdb/classical_modular_forms/main.py +++ b/lmfdb/classical_modular_forms/main.py @@ -582,7 +582,7 @@ def url_for_label(label): return abort(404, "Invalid label") keys = ['level', 'weight', 'char_orbit_label', 'hecke_orbit', 'conrey_index', 'embedding'] keytypes = [POSINT_RE, POSINT_RE, ALPHA_RE, ALPHA_RE, POSINT_RE, POSINT_RE] - for i in range (len(slabel)): + for i in range(len(slabel)): if not keytypes[i].match(slabel[i]): raise ValueError("Invalid label") kwds = {keys[i]: val for i, val in enumerate(slabel)} diff --git a/lmfdb/ecnf/WebEllipticCurve.py b/lmfdb/ecnf/WebEllipticCurve.py index 22b64cb83b..886861429a 100644 --- a/lmfdb/ecnf/WebEllipticCurve.py +++ b/lmfdb/ecnf/WebEllipticCurve.py @@ -84,7 +84,7 @@ def get_nf_info(lab): r""" extract number field label from string and pretty""" try: label = nf_string_to_label(lab) - pretty = field_pretty (label) + pretty = field_pretty(label) except ValueError as err: raise ValueError(Markup("%s is not a valid number field label. %s" % (escape(lab),err))) return label, pretty @@ -566,7 +566,7 @@ def make_E(self): # Regulator only in conditional/unconditional cases, or when we know the rank: BSDReg = None if self.bsd_status in ["conditional", "unconditional"]: - if self.ar == 0: + if self.analytic_rank == 0: BSDReg = 1 self.reg = self.NTreg = web_latex(BSDReg) # otherwise we only get 1.00000... else: @@ -575,7 +575,7 @@ def make_E(self): BSDReg = R * K.degree()**self.rank self.reg = web_latex(R) self.NTreg = web_latex(BSDReg) - except AttributeError: + except Exception: self.reg = "not available" self.NTreg = "not available" elif self.rk != "not available": @@ -652,7 +652,7 @@ def make_E(self): BSDsha_denominator = BSDReg * BSDomega * BSDprodcp BSDsha_from_formula = BSDLvalue * BSDsha_numerator / BSDsha_denominator BSDsha_from_formula_rounded = BSDsha_from_formula.round() - BSDok = (BSDsha_from_formula_rounded == BSDsha) and ((BSDsha_from_formula_rounded -BSDsha_from_formula).abs() < 0.001) + BSDok = (BSDsha_from_formula_rounded == BSDsha) and ((BSDsha_from_formula_rounded - BSDsha_from_formula).abs() < 0.001) #print(f"{BSDsha_from_formula=}") #print(f"{BSDsha_from_formula_rounded=}") #print(f"{BSDsha=}") @@ -686,7 +686,7 @@ def make_E(self): tors2 = '\\#E(K)_{\\mathrm{tor}}^2' rootD = '\\left|d_K\\right|^{1/2}' - lder_name = rf"L^{{({r})}}(E/K,1)/{r}!" if r>=2 else "L'(E/K,1)" if r else "L(E/K,1)" + lder_name = rf"L^{{({r})}}(E/K,1)/{r}!" if r >= 2 else "L'(E/K,1)" if r else "L(E/K,1)" lhs_num = rf'{Sha} {dot} {Om} {dot} {Reg} {dot} {prodcp}' lhs_den = rf'{tors2} {dot} {rootD}' lhs = rf'{frac}{{ {lhs_num} }} {{ {lhs_den} }}' diff --git a/lmfdb/ecnf/main.py b/lmfdb/ecnf/main.py index 22496b4618..7e23feb428 100644 --- a/lmfdb/ecnf/main.py +++ b/lmfdb/ecnf/main.py @@ -200,7 +200,7 @@ def show_ecnf1(nf): if len(request.args) > 0: # if requested field differs from nf, redirect to general search if 'field' in request.args and request.args['field'] != nf_label: - return redirect (url_for(".index", **request.args), 307) + return redirect(url_for(".index", **request.args), 307) info['title'] += ' Search results' info['bread'].append(('Search results','')) info['field'] = nf_label @@ -223,7 +223,7 @@ def show_ecnf_conductor(nf, conductor_label): # if requested field or conductor norm differs from nf or conductor_lable, redirect to general search if ('field' in request.args and request.args['field'] != nf_label) or \ ('conductor_norm' in request.args and request.args['conductor_norm'] != conductor_norm): - return redirect (url_for(".index", **request.args), 307) + return redirect(url_for(".index", **request.args), 307) info['title'] += ' Search results' info['bread'].append(('Search results','')) info['field'] = nf_label @@ -386,7 +386,7 @@ def parse_cm_list(inp, query, qfield): short_title="nonmaximal primes", default=lambda info: info.get("nonmax_primes"), mathmode=True, align="center"), ProcessedCol("galois_images", "ec.galois_rep_modell_image", r"mod-$\ell$ images", lambda v: ", ".join(display_knowl('gl2.subgroup_data', title=s, kwargs={'label':s}) for s in v), - short_title="mod-ℓ images", default=lambda info: info.get ("nonmax_primes") or info.get("galois_image"), align="center"), + short_title="mod-ℓ images", default=lambda info: info.get("nonmax_primes") or info.get("galois_image"), align="center"), MathCol("sha", "ec.analytic_sha_order", r"$Ш_{\textrm{an}}$", short_title="analytic Ш", default=False), ProcessedCol("tamagawa_product", "ec.tamagawa_number", "Tamagawa", lambda v: web_latex(factor(v)), short_title="Tamagawa product", align="center", default=False), ProcessedCol("reg", "ec.regulator", "Regulator", lambda v: str(v)[:11], mathmode=True, align="left", default=False), diff --git a/lmfdb/elliptic_curves/elliptic_curve.py b/lmfdb/elliptic_curves/elliptic_curve.py index ef47bc5ef9..62a2c7e93a 100644 --- a/lmfdb/elliptic_curves/elliptic_curve.py +++ b/lmfdb/elliptic_curves/elliptic_curve.py @@ -252,7 +252,7 @@ def by_conductor(conductor): if request.args: # if conductor changed, fall back to a general search if 'conductor' in request.args and request.args['conductor'] != str(conductor): - return redirect (url_for(".rational_elliptic_curves", **request.args), 307) + return redirect(url_for(".rational_elliptic_curves", **request.args), 307) info['title'] += ' Search results' info['bread'].append(('Search results','')) info['conductor'] = conductor diff --git a/lmfdb/genus2_curves/web_g2c.py b/lmfdb/genus2_curves/web_g2c.py index a60cbc9290..4b951cf8e0 100644 --- a/lmfdb/genus2_curves/web_g2c.py +++ b/lmfdb/genus2_curves/web_g2c.py @@ -898,11 +898,11 @@ def make_object(self, curve, endo, tama, ratpts, clus, galrep, nonsurj, is_curve else: data['mw_group'] = r'\(' + r' \oplus '.join((r'\Z' if n == 0 else r'\Z/{%s}\Z' % n) for n in invs) + r'\)' if lower >= upper: - data['mw_gens_table'] = mw_gens_table (ratpts['mw_invs'], ratpts['mw_gens'], ratpts['mw_heights'], ratpts['rat_pts']) - data['mw_gens_simple_table'] = mw_gens_simple_table (ratpts['mw_invs'], ratpts['mw_gens'], ratpts['mw_heights'], ratpts['rat_pts'], data['min_eqn']) + data['mw_gens_table'] = mw_gens_table(ratpts['mw_invs'], ratpts['mw_gens'], ratpts['mw_heights'], ratpts['rat_pts']) + data['mw_gens_simple_table'] = mw_gens_simple_table(ratpts['mw_invs'], ratpts['mw_gens'], ratpts['mw_heights'], ratpts['rat_pts'], data['min_eqn']) if curve['two_torsion_field'][0]: - data['two_torsion_field_knowl'] = nf_display_knowl (curve['two_torsion_field'][0], field_pretty(curve['two_torsion_field'][0])) + data['two_torsion_field_knowl'] = nf_display_knowl(curve['two_torsion_field'][0], field_pretty(curve['two_torsion_field'][0])) else: t = curve['two_torsion_field'] data['two_torsion_field_knowl'] = r"splitting field of \(%s\) with Galois group %s" % (intlist_to_poly(t[1]),transitive_group_display_knowl(f"{t[2][0]}T{t[2][1]}")) diff --git a/lmfdb/groups/abstract/code.yaml b/lmfdb/groups/abstract/code.yaml index 6977858bcd..df99125e74 100644 --- a/lmfdb/groups/abstract/code.yaml +++ b/lmfdb/groups/abstract/code.yaml @@ -56,7 +56,7 @@ GLZq: GLFq: comment: Define the group as a matrix group with coefficients in GLFq - magma: F:=GF({Fq}); al:=PrimitiveElement(F); G := MatrixGroup< {nFq}, F | {LFq} >; + magma: F:=GF({Fq}); al:=F.1; G := MatrixGroup< {nFq}, F | {LFq} >; gap: G := Group({LFqsplit}); transitive: diff --git a/lmfdb/groups/abstract/web_groups.py b/lmfdb/groups/abstract/web_groups.py index 021bc81a52..e1df744b44 100644 --- a/lmfdb/groups/abstract/web_groups.py +++ b/lmfdb/groups/abstract/web_groups.py @@ -1925,7 +1925,9 @@ def _matrix_coefficient_data(self, rep_type, as_str=False): rep_type = "GLFp" return R, N, k, d, rep_type - def decode_as_matrix(self, code, rep_type, as_str=False, LieType=False, ListForm=False): + def decode_as_matrix(self, code, rep_type, as_str=False, LieType=False, ListForm=False, GLFq_logs=None): + if GLFq_logs is None: + GLFq_logs = as_str or ListForm # ListForm is for code snippet if rep_type == "GLZ" and not isinstance(code, int): # decimal here represents an integer encoding b a, b = str(code).split(".") @@ -1948,13 +1950,14 @@ def pad(X, m): L = pad(L, k * d**2) if rep_type == "GLFq": L = [R(L[i:i+k]) for i in range(0, k*d**2, k)] - L = [l.log(a) if l != 0 else -1 for l in L] #-1 represents 0, to distinguish from a^0 + if GLFq_logs: + L = [l.log(a) if l != 0 else -1 for l in L] #-1 represents 0, to distinguish from a^0 elif rep_type == "GLZ": shift = (N - 1) // 2 L = [c - shift for c in L] if ListForm: return L #as ints representing powers of primitive element if GLFq - if rep_type == "GLFq": + if rep_type == "GLFq" and GLFq_logs: x = matrix(ZZ, d, d, L) #giving powers of alpha (primitive element) else: x = matrix(R, d, d, L) @@ -1963,21 +1966,22 @@ def pad(X, m): if LieType and self.representations["Lie"][0]["family"][0] == "P": return r"\left[" + latex(x) + r"\right]" if rep_type == "GLFq": #need to customize latex command for GLFq - rs = 'r'*d - st_latex = r'\left(\begin{array}{'+rs+'}' - for i in range(d): - for j in range(d): - if j < d-1: - endstr = ' & ' - else: - endstr = r' \\ ' - if L[d*i+j] > 0: - st_latex = st_latex + r'\alpha^{' + str(L[d*i+j]) + '}' + endstr - elif L[d*i+j] == 0: - st_latex = st_latex + str(1) + endstr - else: - st_latex = st_latex + str(0) + endstr - st_latex = st_latex + r'\end{array}\right)' + ls = 'l'*d + st_latex = r'\left(\begin{array}{'+ls+'}' + for i, entrylog in enumerate(L): + if entrylog > 1: + st_latex += rf'\alpha^{{{entrylog}}}' + elif entrylog == 1: + st_latex += r'\alpha' + elif entrylog == 0: + st_latex += "1" + else: + st_latex += "0" + if (i+1)%d == 0: + st_latex += r' \\ ' + else: + st_latex += ' & ' + st_latex += r'\end{array}\right)' return st_latex return latex(x) return x @@ -2236,7 +2240,12 @@ def representation_line(self, rep_type, skip_head=False): # Matrix group R, N, k, d, _ = self._matrix_coefficient_data(rep_type, as_str=True) gens = ", ".join(self.decode_as_matrix(g, rep_type, as_str=True) for g in rdata["gens"]) - gens = fr"$\left\langle {gens} \right\rangle \subseteq \GL_{{{d}}}({R})$" + ambient = fr"\GL_{{{d}}}({R})" + if rep_type == "GLFq": + Fq = GF(N**k, "alpha") + poly = latex(Fq.polynomial()) + ambient += fr" = \GL_{{{d}}}(\F_{{{N}}}[\alpha]/({poly}))" + gens = fr"$\left\langle {gens} \right\rangle \subseteq {ambient}$" code_cmd = self.create_snippet(rep_type) if skip_head: return f'{gens}{code_cmd}' @@ -2735,7 +2744,7 @@ def code_snippets(self): nZN = self.representations["GLZN"]["d"] N = self.representations["GLZN"]["p"] LZN = [self.decode_as_matrix(g, "GLZN", ListForm=True) for g in self.representations["GLZN"]["gens"]] - LZNsplit = "[" + ",".join([split_matrix_list_ZN(self.decode_as_matrix(g, "GLZN", ListForm=True) , nZN, N) for g in self.representations["GLZN"]["gens"]]) + "]" + LZNsplit = "[" + ",".join(split_matrix_list_ZN(mat, nZN, N) for mat in LZN) + "]" else: nZN, N, LZN, LZNsplit = None, None, None, None if "GLZq" in self.representations: @@ -2749,8 +2758,9 @@ def code_snippets(self): if "GLFq" in self.representations: nFq = self.representations["GLFq"]["d"] Fq = self.representations["GLFq"]["q"] - LFq = ",".join([split_matrix_Fq_add_al(self.decode_as_matrix(g, "GLFq", ListForm=True), nFq ) for g in self.representations["GLFq"]["gens"]]) - LFqsplit = "[" + ",".join([split_matrix_list_Fq(self.decode_as_matrix(g, "GLFq", ListForm=True), nFq, Fq) for g in self.representations["GLFq"]["gens"]]) + "]" + mats = [self.decode_as_matrix(g, "GLFq", ListForm=True) for g in self.representations["GLFq"]["gens"]] + LFq = ",".join(split_matrix_Fq_add_al(mat, nFq ) for mat in mats) + LFqsplit = "[" + ",".join(split_matrix_list_Fq(mat, nFq, Fq) for mat in mats) + "]" else: nFq, Fq, LFq, LFqsplit = None, None, None, None diff --git a/lmfdb/higher_genus_w_automorphisms/main.py b/lmfdb/higher_genus_w_automorphisms/main.py index d07b7b3cc8..479db16ddd 100644 --- a/lmfdb/higher_genus_w_automorphisms/main.py +++ b/lmfdb/higher_genus_w_automorphisms/main.py @@ -155,7 +155,7 @@ def decjac_format(decjac_list): entry = entry + "^{" + str(ints[1]) + "}" entries.append(entry) latex = "\\times ".join(entries) - ccClasses = cc_display ([ints[2] for ints in decjac_list]) + ccClasses = cc_display([ints[2] for ints in decjac_list]) return latex, ccClasses # Turn 'i.j' in the total label in to cc displayed in mongo diff --git a/lmfdb/lfunctions/Lfunction.py b/lmfdb/lfunctions/Lfunction.py index d8a4c55173..216a77327a 100644 --- a/lmfdb/lfunctions/Lfunction.py +++ b/lmfdb/lfunctions/Lfunction.py @@ -718,10 +718,10 @@ def __init__(self, **args): # Check for compulsory arguments if self.fromDB: - validate_required_args ('Unable to construct L-function of Maass form.', + validate_required_args('Unable to construct L-function of Maass form.', args, 'group', 'level', 'char', 'R', 'ap_id') else: - validate_required_args ('Unable to construct L-function of Maass form.', + validate_required_args('Unable to construct L-function of Maass form.', args, 'maass_id') self._Ltype = "maass" @@ -848,9 +848,9 @@ def __init__(self, **args): constructor_logger(self, args) # Check for compulsory arguments - validate_required_args ('Unable to construct Hilbert modular form ' + validate_required_args('Unable to construct Hilbert modular form ' + 'L-function.', args, 'label', 'number', 'character') - validate_integer_args ('Unable to construct Hilbert modular form L-function.', + validate_integer_args('Unable to construct Hilbert modular form L-function.', args, 'character','number') self._Ltype = "hilbertmodularform" @@ -1125,7 +1125,7 @@ def __init__(self, **args): constructor_logger(self, args) # Check for compulsory arguments - validate_required_args ('Unable to construct Dedekind zeta function.', args, 'label') + validate_required_args('Unable to construct Dedekind zeta function.', args, 'label') self._Ltype = "dedekindzeta" # Put the arguments into the object dictionary @@ -1434,7 +1434,7 @@ def __init__(self, **args): validate_required_args('Unable to construct symmetric power L-function.', args, 'power', 'underlying_type', 'field', 'conductor', 'isogeny') - validate_integer_args ('The power has to be an integer.', + validate_integer_args('The power has to be an integer.', args, 'power', 'conductor') self._Ltype = "SymmetricPower" diff --git a/lmfdb/local_fields/main.py b/lmfdb/local_fields/main.py index 7fe40c7510..53c929346b 100644 --- a/lmfdb/local_fields/main.py +++ b/lmfdb/local_fields/main.py @@ -304,6 +304,18 @@ def galcolresponse(n,t,cache): return 'not computed' return group_pretty_and_nTj(n, t, cache=cache) +def formatbracketcol(blist): + if blist == []: + return r'$[\ ]$' + if blist == '': + return 'not computed' + return f'${blist}$' + +def intcol(j): + if j == '': + return 'not computed' + return f'${j}$' + lf_columns = SearchColumns([ LinkCol("label", "lf.field.label", "Label", url_for_label), MathCol("n", "lf.degree", "$n$", short_title="degree", default=False), @@ -316,8 +328,8 @@ def galcolresponse(n,t,cache): ["n", "gal", "cache"], galcolresponse, apply_download=lambda n, t, cache: [n, t]), - MathCol("u", "lf.unramified_degree", "$u$", short_title="unramified degree", default=False), - MathCol("t", "lf.tame_degree", "$t$", short_title="tame degree", default=False), + ProcessedCol("u", "lf.unramified_degree", "$u$", intcol, short_title="unramified degree", default=False), + ProcessedCol("t", "lf.tame_degree", "$t$", intcol, short_title="tame degree", default=False), ListCol("visible", "lf.visible_slopes", "Visible slopes", show_slopes2, default=lambda info: info.get("visible"), mathmode=True), MultiProcessedCol("slopes", "lf.slope_content", "Slope content", @@ -327,8 +339,8 @@ def galcolresponse(n,t,cache): # want apply_download for download conversion PolynomialCol("unram", "lf.unramified_subfield", "Unram. Ext.", default=lambda info:info.get("visible")), ProcessedCol("eisen", "lf.eisenstein_polynomial", "Eisen. Poly.", default=lambda info:info.get("visible"), mathmode=True, func=format_eisen), - MathCol("ind_of_insep", "lf.indices_of_inseparability", "Ind. of Insep.", default=lambda info: info.get("ind_of_insep")), - MathCol("associated_inertia", "lf.associated_inertia", "Assoc. Inertia", default=lambda info: info.get("associated_inertia"))], + ProcessedCol("ind_of_insep", "lf.indices_of_inseparability", "Ind. of Insep.", formatbracketcol, default=lambda info: info.get("ind_of_insep")), + ProcessedCol("associated_inertia", "lf.associated_inertia", "Assoc. Inertia", formatbracketcol, default=lambda info: info.get("associated_inertia"))], db_cols=["c", "coeffs", "e", "f", "gal", "label", "n", "p", "slopes", "t", "u", "visible", "ind_of_insep", "associated_inertia","unram","eisen"]) def lf_postprocess(res, info, query): @@ -446,7 +458,7 @@ def render_field_webpage(args): if 'wild_gap' in data and data['wild_gap'] != [0,0]: wild_inertia = abstract_group_display_knowl(f"{data['wild_gap'][0]}.{data['wild_gap'][1]}") else: - wild_inertia = 'data not computed' + wild_inertia = 'Not computed' info.update({ 'polynomial': raw_typeset(polynomial), @@ -455,8 +467,6 @@ def render_field_webpage(args): 'c': data['c'], 'e': data['e'], 'f': data['f'], - 't': data['t'], - 'u': data['u'], 'rf': lf_display_knowl( rflabel, name=printquad(data['rf'], p)), 'base': lf_display_knowl(str(p)+'.1.0.1', name='$%s$' % Qp), 'hw': data['hw'], @@ -475,8 +485,9 @@ def render_field_webpage(args): info.update({'slopes': show_slopes(data['slopes'])}) if 'inertia' in data: info.update({'inertia': group_display_inertia(data['inertia'])}) - if 'gms' in data: - info.update({'gms': data['gms']}) + for k in ['gms', 't', 'u']: + if k in data: + info.update({k: data[k]}) if 'ram_poly_vert' in data: info.update({'ram_polygon_plot': plot_polygon(data['ram_poly_vert'], data['residual_polynomials'], data['ind_of_insep'], p)}) if 'residual_polynomials' in data: diff --git a/lmfdb/local_fields/templates/lf-show-field.html b/lmfdb/local_fields/templates/lf-show-field.html index 013ed8f248..62a3d5802b 100644 --- a/lmfdb/local_fields/templates/lf-show-field.html +++ b/lmfdb/local_fields/templates/lf-show-field.html @@ -62,7 +62,7 @@

{{ KNOWL('lf.ramification_polygon_display', title='Ramification polygon') }} {{ KNOWL('lf.indices_of_inseparability', 'Indices of inseparability')}}:{{info.ind_insep|safe}} {% else %} - Data not computed + Not computed {% endif %} diff --git a/lmfdb/sato_tate_groups/main.py b/lmfdb/sato_tate_groups/main.py index 8a522f252f..4d1c1e9f5c 100644 --- a/lmfdb/sato_tate_groups/main.py +++ b/lmfdb/sato_tate_groups/main.py @@ -859,7 +859,7 @@ def render_by_label(label): data, in_database = st_lookup(label) info = {} if data is None: - flash_error ("%s is not the label of a Sato-Tate group currently in the database.", label) + flash_error("%s is not the label of a Sato-Tate group currently in the database.", label) return redirect(url_for(".index")) for attr in ['label','weight','degree','name','pretty','real_dimension','components']: info[attr] = data[attr] @@ -868,7 +868,7 @@ def render_by_label(label): info['rational'] = boolean_name(info.get('rational',True)) st0 = db.gps_st0.lucky({'name':data['identity_component']}) if not st0: - flash_error ("%s is not the label of a Sato-Tate identity component currently in the database.", data['identity_component']) + flash_error("%s is not the label of a Sato-Tate identity component currently in the database.", data['identity_component']) return redirect(url_for(".index")) info['symplectic_form'] = st0.get('symplectic_form') info['hodge_circle'] = st0.get('hodge_circle') @@ -883,7 +883,7 @@ def render_by_label(label): else: G = db.gps_groups.lookup(data['component_group']) if not G: - flash_error ("%s is not the label of a Sato-Tate component group currently in the database.", data['component_group']) + flash_error("%s is not the label of a Sato-Tate component group currently in the database.", data['component_group']) return redirect(url_for(".index")) info['component_group'] = G['tex_name'] info['cyclic'] = boolean_name(G['cyclic']) diff --git a/lmfdb/siegel_modular_forms/siegel_modular_form.py b/lmfdb/siegel_modular_forms/siegel_modular_form.py index 70e2f8b361..4673a023fd 100644 --- a/lmfdb/siegel_modular_forms/siegel_modular_form.py +++ b/lmfdb/siegel_modular_forms/siegel_modular_form.py @@ -63,7 +63,7 @@ def by_label(label): bread = [("Modular forms", url_for('modular_forms')), ('Siegel', url_for('.index'))] slabel = label.split('.') - family = get_smf_family (slabel[0]) + family = get_smf_family(slabel[0]) if family: if len(slabel) == 1: return render_family_page(family, request.args, bread) @@ -197,7 +197,7 @@ def render_family_page(family, args, bread): forms = [ (k, [(f.name(), f.degree_of_field()) for f in sams if k == f.weight()]) for k in Set(f.weight() for f in sams)] info = { 'family': family, 'forms': forms, 'args': to_dict(args) } if family.computes_dimensions(): - build_dimension_table (info, family, args) + build_dimension_table(info, family, args) bread.append(('$'+family.latex_name+'$', '')) return render_template("ModularForm_GSp4_Q_family.html", title='Siegel modular forms for $'+family.latex_name+'$', bread=bread, info=info) @@ -209,9 +209,9 @@ def render_search_results_page(args, bread): info = { 'args': to_dict(args) } query = {} try: - parse_ints (info['args'], query, 'deg', 'degree', qfield="degree") - parse_ints (info['args'], query, 'wt', '$k$', qfield="weight") - parse_ints (info['args'], query, 'fdeg', 'field degree') + parse_ints(info['args'], query, 'deg', 'degree', qfield="degree") + parse_ints(info['args'], query, 'wt', '$k$', qfield="weight") + parse_ints(info['args'], query, 'fdeg', 'field degree') except ValueError: info['error'] = True if not info.get('error'): @@ -237,7 +237,7 @@ def render_dimension_table_page(args, bread): if 'j' not in family.latex_name and 'j' in info['args'] and info['args']['j'] != '0': flash_error("$j$ = %s should not be specified for the selected space %s", info['args']['j'], '$'+family.latex_name+'$') else: - build_dimension_table (info, family, info['args']) + build_dimension_table(info, family, info['args']) bread.append(('Dimensions', 'dimensions')) return render_template("ModularForm_GSp4_Q_dimensions.html", title='Siegel modular forms dimension tables', bread=bread, info=info) diff --git a/tox.ini b/tox.ini index 67f280aced..3c205a197e 100644 --- a/tox.ini +++ b/tox.ini @@ -26,8 +26,9 @@ commands = pyflakes start-lmfdb.py user-manager.py lmfdb/ pylint --score=no -d C,R,E,W -e W0129,W0108 start-lmfdb.py user-manager.py lmfdb/ # see https://pycodequ.al/docs/pylint-messages/Warnings.html - # E722 do not use bare except, specify exception instead # E111 indentation is not a multiple of four + # E211 whitespace before '(' # E702 multiple statements on one line (semicolon) - # W391 blank line at end of file - pycodestyle --select=E111,E722,E711,E702 lmfdb/ + # E711 Comparison to None should be 'cond is None:' + # E722 do not use bare except, specify exception instead + pycodestyle --select=E111,E211,E702,E711,E722 lmfdb/