From 97b00b8945aecb19379fc74c7c221d84b3fe98c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sun, 25 Aug 2024 16:22:35 +0200 Subject: [PATCH 01/18] remove unused config file, remove useless wraps by int, etc --- .lgtm.yml | 4 -- lmfdb/groups/abstract/web_groups.py | 5 +- lmfdb/hilbert_modular_forms/web_HMF.py | 6 +-- lmfdb/lfunctions/Lfunction.py | 2 +- lmfdb/modlmf/main.py | 4 +- lmfdb/modular_curves/main.py | 2 +- lmfdb/sato_tate_groups/main.py | 8 +-- lmfdb/sato_tate_groups/test_st.py | 4 +- lmfdb/siegel_modular_forms/family_data.py | 56 ++++++++++----------- lmfdb/utils/uploader.py | 2 +- lmfdb/verify/modcurve/modcurve_modelmaps.py | 5 +- 11 files changed, 48 insertions(+), 50 deletions(-) delete mode 100644 .lgtm.yml diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index b06edf3510..0000000000 --- a/.lgtm.yml +++ /dev/null @@ -1,4 +0,0 @@ -extraction: - python: - python_setup: - version: 3 diff --git a/lmfdb/groups/abstract/web_groups.py b/lmfdb/groups/abstract/web_groups.py index 46ffd39858..8b99231731 100644 --- a/lmfdb/groups/abstract/web_groups.py +++ b/lmfdb/groups/abstract/web_groups.py @@ -2186,9 +2186,10 @@ def myisinner(a): elif rep_type == "Perm": inners = [str(z) for z in inners] else: - if self.element_repr_type=="GLFq": + if self.element_repr_type == "GLFq": R, N, k, d, rep_type = self._matrix_coefficient_data(self.element_repr_type) - inners = [matrix(R,d,d,[[z for z in zz] for zz in z3]) if z3 != '' else '' for z3 in inners] + inners = [matrix(R, d, d, [list(zz) for zz in z3]) + if z3 != '' else '' for z3 in inners] inners = [latex(matrix(z)) if z != '' else '' for z in inners] return {'orders': orders, 'inners': inners} diff --git a/lmfdb/hilbert_modular_forms/web_HMF.py b/lmfdb/hilbert_modular_forms/web_HMF.py index 4cf8b830f1..33fd81bd89 100644 --- a/lmfdb/hilbert_modular_forms/web_HMF.py +++ b/lmfdb/hilbert_modular_forms/web_HMF.py @@ -101,7 +101,7 @@ def create_from_data_string(self, label_or_field, L): # The weight - data['parallel_weight'] = int(2) + data['parallel_weight'] = 2 data['weight'] = str([data['parallel_weight']] * F.degree()) weight = [2] * F.degree() @@ -126,14 +126,14 @@ def create_from_data_string(self, label_or_field, L): i = L.find("x") j = L.find(i+1,",") data['hecke_polynomial'] = pol = L[i:j] - data['dimension'] = int(1) + data['dimension'] = 1 x = polygen(QQ) hpol = x.parent()(str(pol)) data['dimension'] = int(hpol.degree()) else: # rational data['hecke_polynomial'] = 'x' - data['dimension'] = int(1) + data['dimension'] = 1 i = L.rfind("[") j = L.rfind("]") diff --git a/lmfdb/lfunctions/Lfunction.py b/lmfdb/lfunctions/Lfunction.py index 34515748b2..0d82cc5fc9 100644 --- a/lmfdb/lfunctions/Lfunction.py +++ b/lmfdb/lfunctions/Lfunction.py @@ -1074,7 +1074,7 @@ def __init__(self, **args): self.quasidegree = 1 self.level_factored = self.level = 1 self.mu_fe = [] # the shifts of the Gamma_R to print - self.automorphyexp = float(self.weight) - float(1.5) + self.automorphyexp = float(self.weight) - 1.5 self.nu_fe = [Rational(1/2), self.automorphyexp] # the shift of the Gamma_C to print self.compute_kappa_lambda_Q_from_mu_nu() self.algebraic = True diff --git a/lmfdb/modlmf/main.py b/lmfdb/modlmf/main.py index bb4bb835e4..d669cdad1c 100644 --- a/lmfdb/modlmf/main.py +++ b/lmfdb/modlmf/main.py @@ -189,9 +189,9 @@ def render_modlmf_webpage(**args): info['coeffs']=[str(s).replace('x','a').replace('*','') for s in data['coeffs']] - if data['deg'] != int(1): + if data['deg'] != 1: try: - pol=str(conway_polynomial(data['characteristic'], data['deg'])).replace('x','a').replace('*','') + pol = str(conway_polynomial(data['characteristic'], data['deg'])).replace('x','a').replace('*','') info['field']= pol except Exception: info['field']="" diff --git a/lmfdb/modular_curves/main.py b/lmfdb/modular_curves/main.py index 895fb9e1f4..cbe3c56ca9 100644 --- a/lmfdb/modular_curves/main.py +++ b/lmfdb/modular_curves/main.py @@ -1259,7 +1259,7 @@ def modcurve_data(label): "coarse_class_num" : iso_num, "contains_negative_one" : "yes"}, "label") - labels = [lab for lab in labels] + labels = list(labels) label_tables_cols = [(label, "gps_gl2zhat_fine", "label") for label in labels] else: label_tables_cols = [(label, "gps_gl2zhat_fine", "label")] diff --git a/lmfdb/sato_tate_groups/main.py b/lmfdb/sato_tate_groups/main.py index 087b6e9bfb..db29657df9 100644 --- a/lmfdb/sato_tate_groups/main.py +++ b/lmfdb/sato_tate_groups/main.py @@ -684,13 +684,13 @@ def mu_data(n): assert n > 0 n = ZZ(n) rec = {} - rec['label'] = "0.1.%d"%n - rec['label_components'] = [int(0),int(1),int(0),int(n)] + rec['label'] = "0.1.%d" % n + rec['label_components'] = [0, 1, 0, int(n)] rec['weight'] = 0 rec['degree'] = 1 rec['rational'] = bool(n <= 2) - rec['name'] = 'mu(%d)'%n - rec['pretty'] = r'\mu(%d)'%n + rec['name'] = 'mu(%d)' % n + rec['pretty'] = r'\mu(%d)' % n rec['real_dimension'] = 0 rec['components'] = int(n) rec['component_group'] = db.gps_special_names.lucky({'family':'C','parameters':{'n':n}},projection='label') diff --git a/lmfdb/sato_tate_groups/test_st.py b/lmfdb/sato_tate_groups/test_st.py index 84e77450a2..9f1136e139 100644 --- a/lmfdb/sato_tate_groups/test_st.py +++ b/lmfdb/sato_tate_groups/test_st.py @@ -71,7 +71,7 @@ def test_completeness(self): import sys L = self.tc.get('/SatoTateGroup/?weight=1°ree=2') assert '3 matches' in L.get_data(as_text=True) - data = list(db.gps_st.search({'weight':int(1),'degree':int(2)}, projection='label')) + data = list(db.gps_st.search({'weight': 1, 'degree': 2}, projection='label')) assert len(data) == 3 print("") for label in data: @@ -81,7 +81,7 @@ def test_completeness(self): assert label in L.get_data(as_text=True) and 'Moment sequences' in L.get_data(as_text=True) L = self.tc.get('/SatoTateGroup/?weight=1°ree=4') assert 'of 52' in L.get_data(as_text=True) - data = list(db.gps_st.search({'weight':int(1),'degree':int(4)}, projection='label')) + data = list(db.gps_st.search({'weight': 1, 'degree': 4}, projection='label')) assert len(data) == 52 for label in data: diff --git a/lmfdb/siegel_modular_forms/family_data.py b/lmfdb/siegel_modular_forms/family_data.py index 024ffa9897..cab7753e82 100644 --- a/lmfdb/siegel_modular_forms/family_data.py +++ b/lmfdb/siegel_modular_forms/family_data.py @@ -3,99 +3,99 @@ families = [ { "name": "Gamma0_2", - "degree": int(2), + "degree": 2, "dim_args_default": {"k": "4..24", "j": "2"}, "latex_name": "M_{k,j}\\left(\\Gamma_0(2)\\right)", - "order": int(50) + "order": 50 }, { "name": "Gamma0_3", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "0..20" }, "latex_name": "M_k\\left(\\Gamma_0(3)\\right)", - "order": int(80) + "order": 80 }, { "name": "Gamma0_3_psi_3", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "0..20" }, "latex_name": "M_k\\left(\\Gamma_0(3),\\psi_3\\right)", - "order": int(90) + "order": 90 }, { "name": "Gamma0_4_half", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "1..20" }, "latex_name": "M_{k-1/2}\\left(\\Gamma_0(4)\\right)", - "order": int(108) + "order": 108 }, { "name": "Gamma0_4", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "0..20" }, "latex_name": "M_k\\left(\\Gamma_0(4)\\right)", - "order": int(100) + "order": 100 }, { "name": "Gamma0_4_psi_4", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "0..40" }, "latex_name": "M_k\\left(\\Gamma_0(4),\\psi_4\\right)", - "order": int(105) + "order": 105 }, { "name": "Gamma1_2", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "4..10", "j": "2" }, "latex_name": "M_{k,j}\\left(\\Gamma_1(2)\\right)", - "order": int(60) + "order": 60 }, { "name": "Gamma_2", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "4..10", "j": "2" }, "latex_name": "M_{k,j}\\left(\\Gamma(2)\\right)", - "order": int(70) + "order": 70 }, { "name": "Kp", - "degree": int(2), + "degree": 2, "latex_name": "M_2\\left(K(p)\\right)", - "order": int(110) + "order": 110 }, { "name": "Sp4Z_2", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "4..24" }, "latex_name": "M_{k,2}\\left(\\textrm{Sp}(4,\\mathbb{Z})\\right)", - "order": int(30) + "order": 30 }, { "name": "Sp4Z_j", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "4..24", "j": "4" }, "latex_name": "M_{k,j}\\left(\\textrm{Sp}(4,\\mathbb{Z})\\right)", - "order": int(40) + "order": 40 }, { "name": "Sp4Z", - "degree": int(2), + "degree": 2, "dim_args_default": { "k": "0..20" }, "latex_name": "M_k\\left({\\textrm{Sp}}(4,\\mathbb{Z})\\right)", - "order": int(10) + "order": 10 }, { "name": "Sp6Z", - "degree": int(3), + "degree": 3, "dim_args_default": { "k": "0..20" }, "latex_name": "M_{k}\\left(\\textrm{Sp}(6,\\mathbb{Z})\\right)", - "order": int(130) + "order": 130 }, { "name": "Sp8Z", - "degree": int(4), + "degree": 4, "dim_args_default": { "k": "0..16" }, "latex_name": "M_k\\left(\\textrm{Sp}(8,\\mathbb{Z})\\right)", - "order": int(140) + "order": 140 }, ] diff --git a/lmfdb/utils/uploader.py b/lmfdb/utils/uploader.py index ac804d0540..c0f6f98db0 100644 --- a/lmfdb/utils/uploader.py +++ b/lmfdb/utils/uploader.py @@ -296,7 +296,7 @@ def header(self): @lazy_attribute def header_dict(self): - return {name: box for (name, box) in zip(self.header, self.inputs)} + return dict(zip(self.header, self.inputs)) def parse_csv(self, stream): reader = csv.reader(stream) diff --git a/lmfdb/verify/modcurve/modcurve_modelmaps.py b/lmfdb/verify/modcurve/modcurve_modelmaps.py index e3c3134d02..73078f6426 100644 --- a/lmfdb/verify/modcurve/modcurve_modelmaps.py +++ b/lmfdb/verify/modcurve/modcurve_modelmaps.py @@ -58,14 +58,15 @@ def check_rat_pts_map_to_rat_pts(self, rec): pt_on_codomain_as_list = apply_map_to_pt(rec['coordinates'], rel_pt) # TEST 1: check this pt is rational - if not all([t in QQ for t in pt_on_codomain_as_list]): + if not all(t in QQ for t in pt_on_codomain_as_list): return False # TEST 2: check this is actually a point on the codomain equation, number_variables = self.modcurve_models[rec["codomain_label"], rec["codomain_model_type"]] Pol = PolynomialRing(QQ, number_variables, names=VARORDER[:number_variables]) - if not all([Pol(f_str)(pt_on_codomain_as_list) == 0 for f_str in equation]): + if not all(Pol(f_str)(pt_on_codomain_as_list) == 0 + for f_str in equation): return False return True From 9b8a611c70e859a62451523ae558e45b3da52829 Mon Sep 17 00:00:00 2001 From: John Jones Date: Sun, 25 Aug 2024 11:14:13 -0400 Subject: [PATCH 02/18] Fix links from stats --- lmfdb/modl_galois_representations/main.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lmfdb/modl_galois_representations/main.py b/lmfdb/modl_galois_representations/main.py index 565426ce35..2f214bbd6c 100644 --- a/lmfdb/modl_galois_representations/main.py +++ b/lmfdb/modl_galois_representations/main.py @@ -24,6 +24,7 @@ parse_bool, parse_primes, parse_rats, + parse_group_label_or_order, parse_kerpol_string, integer_divisors, StatsDisplay, @@ -42,7 +43,7 @@ from lmfdb.number_fields.web_number_field import formatfield from lmfdb.modl_galois_representations import modlgal_page from lmfdb.modl_galois_representations.web_modlgal import WebModLGalRep, get_bread, codomain, image_pretty_with_abstract -from lmfdb.groups.abstract.main import abstract_group_display_knowl +from lmfdb.groups.abstract.main import abstract_group_display_knowl, abstract_group_label_regex LABEL_RE = re.compile(r"[1-9]\d*.[1-9]\d*.[1-9]\d*.[1-9]\d*(-[1-9]\d*)?") @@ -174,6 +175,7 @@ def modlgal_search(info, query): parse_ints(info, query, "conductor") parse_ints(info, query, "image_index") parse_ints(info, query, "image_order") + parse_ints(info, query, "base_ring_order") if info.get('conductor_type'): if info['conductor_type'] == 'prime': query['conductor_num_primes'] = 1 @@ -207,6 +209,7 @@ def modlgal_search(info, query): parse_bool(info, query, "determinant_index", process=lambda a: 1 if a else {"$gt":1}) parse_kerpol_string(info, query, 'kernel_polynomial') parse_kerpol_string(info, query, "projective_kernel_polynomial") + parse_group_label_or_order(info, query, "image_abstract_group", regex=abstract_group_label_regex) class ModLGalRepSearchArray(SearchArray): @@ -306,6 +309,11 @@ def __init__(self): label="Image order", example="2", example_span="12, 10-20") + image_abstract_group = TextBox( + name="image_abstract_group", + knowl="modlgal.image_abstract_group", + label="Abstract image", + example="4.3") kernel_field = TextBox( name="kernel_polynomial", knowl="modlgal.min_sib_splitting_field", @@ -328,16 +336,16 @@ def __init__(self): [conductor, absolutely_irreducible], [conductor_primes, solvable], [image_index, determinant_index], - [image_order, top_slope], + [image_order, image_abstract_group], [kernel_field, projective_kernel_field], - [count] + [count, top_slope] ] self.refine_array = [ [base_ring_characteristic, dimension, conductor, conductor_primes], [codomain, solvable, surjective, absolutely_irreducible], - [top_slope, image_index, image_order, determinant_index], - [kernel_field, projective_kernel_field] + [image_index, image_order, image_abstract_group, determinant_index], + [top_slope, kernel_field, projective_kernel_field] ] #sort_knowl = "modlgal.sort_order" @@ -388,6 +396,7 @@ def summary(self): } short_display = {'image_abstract_group': 'image'} formatters = {'image_abstract_group': groupformatter} + query_formatters = {'image_abstract_group': lambda x: "image_abstract_group=%s" % x} stat_list = [ {'cols': ['conductor', 'dimension'], 'proportioner': proportioners.per_row_total, From bfa4d639628bd9d268aa9ed1ab39e1d2b93bf4ea Mon Sep 17 00:00:00 2001 From: John Jones Date: Fri, 23 Aug 2024 19:08:31 -0400 Subject: [PATCH 03/18] Start --- lmfdb/number_fields/templates/nf-show-field.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lmfdb/number_fields/templates/nf-show-field.html b/lmfdb/number_fields/templates/nf-show-field.html index dd3657fdf8..a43d23c6e7 100644 --- a/lmfdb/number_fields/templates/nf-show-field.html +++ b/lmfdb/number_fields/templates/nf-show-field.html @@ -82,6 +82,11 @@

{{ KNOWL('nf.ideal_class_group', title='Class group') }} and {{ KNOWL('nf. {{ info.grh_label|safe }} {{ place_code('class_group') }}

+ {% if nf.is_cm_field() %} +

+ Relative class number: {{ nf.relh() }} +

+ {% endif %}

{{ KNOWL('nf.unit_group', title='Unit group') }}

From 89dd00218ed9c09fbf8b1ca81b7cdb8cbf6f2d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 2 Sep 2024 17:27:25 +0200 Subject: [PATCH 04/18] a few typos and more blank lines (pep E302) --- lmfdb/abvar/fq/download.py | 1 + lmfdb/abvar/fq/search_parsing.py | 2 ++ lmfdb/elliptic_curves/congruent_numbers.py | 5 +++++ lmfdb/elliptic_curves/isog_class.py | 2 ++ lmfdb/elliptic_curves/test_browse_page.py | 1 + lmfdb/galois_groups/templates/character-table.html | 2 +- lmfdb/galois_groups/transitive_group.py | 2 +- lmfdb/groups/abstract/main.py | 4 ++-- lmfdb/groups/abstract/web_groups.py | 2 +- lmfdb/hecke_algebras/hecke_algebras_stats.py | 2 ++ lmfdb/hecke_algebras/test_hecke_algebras.py | 1 + lmfdb/lfunctions/Lfunction.py | 2 ++ lmfdb/lfunctions/test_lfunctions.py | 1 + lmfdb/maass_forms/templates/maass_browse_graph.html | 2 +- lmfdb/maass_forms/web_maassform.py | 4 ++-- lmfdb/modular_curves/upload.py | 8 ++++---- lmfdb/modular_curves/web_curve.py | 8 ++++---- lmfdb/uploads/process.py | 2 +- lmfdb/utils/display_stats.py | 2 +- lmfdb/utils/downloader.py | 2 +- lmfdb/utils/uploader.py | 5 +++-- 21 files changed, 39 insertions(+), 21 deletions(-) diff --git a/lmfdb/abvar/fq/download.py b/lmfdb/abvar/fq/download.py index d47004ea2a..ede1703fea 100644 --- a/lmfdb/abvar/fq/download.py +++ b/lmfdb/abvar/fq/download.py @@ -4,6 +4,7 @@ from psycodict.encoding import Json from .isog_class import AbvarFq_isoclass + class AbvarFq_download(Downloader): table = db.av_fq_isog title = 'Abelian variety isogeny classes' diff --git a/lmfdb/abvar/fq/search_parsing.py b/lmfdb/abvar/fq/search_parsing.py index 92f218e4e5..c1b7e75fb4 100644 --- a/lmfdb/abvar/fq/search_parsing.py +++ b/lmfdb/abvar/fq/search_parsing.py @@ -4,11 +4,13 @@ _parse_subset, ) + @search_parser # see SearchParser.__call__ for actual arguments when calling def parse_nf_string(inp, query, qfield): fields = [nf_string_to_label(field) for field in inp.split(",")] _parse_subset(fields, query, qfield, mode=None, radical=None, product=None, cardinality=None) + @search_parser # (clean_info=True, default_field='galois_group', default_name='Galois group', default_qfield='galois') # see SearchParser.__call__ for actual arguments when calling def parse_galgrp(inp, query, qfield): from lmfdb.galois_groups.transitive_group import complete_group_codes diff --git a/lmfdb/elliptic_curves/congruent_numbers.py b/lmfdb/elliptic_curves/congruent_numbers.py index fd75646038..cb7b31a9c4 100644 --- a/lmfdb/elliptic_curves/congruent_numbers.py +++ b/lmfdb/elliptic_curves/congruent_numbers.py @@ -8,18 +8,23 @@ congruent_number_data_directory = os.path.expanduser('~/data/congruent_number_curves') + def CNfilename(file_suffix): return os.path.join(congruent_number_data_directory, "CN.{}".format(file_suffix)) + def get_CN_data_old(fs, n): with open(CNfilename(fs)) as data: return data.readlines()[n-1].split() + def get_CN_data_new(fs, n): return linecache.getline(CNfilename(fs), n).split() + get_CN_data = get_CN_data_new + def parse_gens_string(s): if s == '[]': return [] diff --git a/lmfdb/elliptic_curves/isog_class.py b/lmfdb/elliptic_curves/isog_class.py index 86cc20d8c2..dd23323a47 100644 --- a/lmfdb/elliptic_curves/isog_class.py +++ b/lmfdb/elliptic_curves/isog_class.py @@ -7,6 +7,7 @@ from sage.all import latex, PowerSeriesRing, QQ, ZZ, RealField + class ECisog_class(): """ Class for an isogeny class of elliptic curves over Q @@ -187,6 +188,7 @@ def perm(i): return next(c for c in self.curves if c['Cnumber']==i+1)['lmfdb_num self.code['matrix'] = {'sage':'E.isogeny_class().matrix()'} self.code['plot'] = {'sage':'E.isogeny_graph().plot(edge_labels=True)'} + def make_graph(M, vertex_labels=None): """ Code extracted from Sage's elliptic curve isogeny class (reshaped diff --git a/lmfdb/elliptic_curves/test_browse_page.py b/lmfdb/elliptic_curves/test_browse_page.py index 955ca085d7..bb2db3e458 100644 --- a/lmfdb/elliptic_curves/test_browse_page.py +++ b/lmfdb/elliptic_curves/test_browse_page.py @@ -1,5 +1,6 @@ from lmfdb.tests import LmfdbTest + class HomePageTest(LmfdbTest): # All tests should pass # diff --git a/lmfdb/galois_groups/templates/character-table.html b/lmfdb/galois_groups/templates/character-table.html index e499af1180..14d1358cdb 100644 --- a/lmfdb/galois_groups/templates/character-table.html +++ b/lmfdb/galois_groups/templates/character-table.html @@ -3,7 +3,7 @@ {%- set dummy = gp.conjclasses -%} {%- set ccs = gp.conjugacy_classes -%} {%- if info.char_highlight -%} -

The row representing the character {{info.char_highlight}} is highighted below.

+

The row representing the character {{info.char_highlight}} is highlighted below.

{%- endif -%} diff --git a/lmfdb/galois_groups/transitive_group.py b/lmfdb/galois_groups/transitive_group.py index 700a636ba0..3d577c4951 100644 --- a/lmfdb/galois_groups/transitive_group.py +++ b/lmfdb/galois_groups/transitive_group.py @@ -660,7 +660,7 @@ def complete_group_code(code): n = int(rematch.group(1)) t = int(rematch.group(2)) return [(n, t)] - # covert GAP code to abstract group label + # convert GAP code to abstract group label rematch = re.match(r'^\[(\d+),(\d+)\]$', code) if rematch: code = "%s.%s" % (rematch.group(1), rematch.group(2)) diff --git a/lmfdb/groups/abstract/main.py b/lmfdb/groups/abstract/main.py index b0c0df343f..76d1f9f5b1 100644 --- a/lmfdb/groups/abstract/main.py +++ b/lmfdb/groups/abstract/main.py @@ -1920,9 +1920,9 @@ def download_group(**args): # This needs to change for larger groups if gp_data["solvable"]: s += com + " The group will be created as a polycylic group (not necessarily matching the presentation in the LMFDB).\n" - s += com + ' You can turn it into a permuation group using "PermGroup(G)".\n' + s += com + ' You can turn it into a permutation group using "PermGroup(G)".\n' else: - s += com + " The group will be created as a permuation group (not necessarily using the generators used in the LMFDB).\n" + s += com + " The group will be created as a permutation group (not necessarily using the generators used in the LMFDB).\n" s += com2 + "\n" s += "\n" s += "G = small_group(%s,%s)" % tuple(label.split(".")) diff --git a/lmfdb/groups/abstract/web_groups.py b/lmfdb/groups/abstract/web_groups.py index 8b99231731..0818ed6bd5 100644 --- a/lmfdb/groups/abstract/web_groups.py +++ b/lmfdb/groups/abstract/web_groups.py @@ -2674,7 +2674,7 @@ def create_snippet(self,item): if isinstance(code[item][L],str): lines = code[item][L].split('\n')[:-1] if '\n' in code[item][L] else [code[item][L]] lines = [line.replace("<", "<").replace(">", ">") for line in lines] - else: # not currrently used in groups + else: # not currently used in groups lines = code[item][L] prompt = code['prompt'][L] if 'prompt' in code and L in code['prompt'] else L class_str = " ".join([L,'nodisplay','codebox']) diff --git a/lmfdb/hecke_algebras/hecke_algebras_stats.py b/lmfdb/hecke_algebras/hecke_algebras_stats.py index 7cc3f94976..6b3d0fc083 100644 --- a/lmfdb/hecke_algebras/hecke_algebras_stats.py +++ b/lmfdb/hecke_algebras/hecke_algebras_stats.py @@ -5,6 +5,7 @@ logger = make_logger("hecke_algebras") + def hecke_algebras_summary(): hecke_knowl = 'Hecke algebras' level_knowl = 'level' @@ -17,6 +18,7 @@ def hecke_algebras_summary(): hecke_knowl,'. The largest ', level_knowl, ' for ', gamma0_knowl, ' is {}, '.format(comma(max_level)), 'the largest ', weight_knowl, ' is {}.'.format(comma(max_weight))]) + @app.context_processor def ctx_hecke_algebras_summary(): return {'hecke_algebras_summary': hecke_algebras_summary} diff --git a/lmfdb/hecke_algebras/test_hecke_algebras.py b/lmfdb/hecke_algebras/test_hecke_algebras.py index 8a9aa661d9..7865a2dcc9 100644 --- a/lmfdb/hecke_algebras/test_hecke_algebras.py +++ b/lmfdb/hecke_algebras/test_hecke_algebras.py @@ -1,6 +1,7 @@ from lmfdb.tests import LmfdbTest + class HomePageTest(LmfdbTest): # Hecke algebra browse page def test_hecke_algebra(self): diff --git a/lmfdb/lfunctions/Lfunction.py b/lmfdb/lfunctions/Lfunction.py index 0d82cc5fc9..d80b1df885 100644 --- a/lmfdb/lfunctions/Lfunction.py +++ b/lmfdb/lfunctions/Lfunction.py @@ -129,6 +129,7 @@ def an_from_data(euler_factors,upperbound=30): return result + # Convert the information extracted from the database to the format # expected by the L-functions homepage template. # As of July 2015, some of the fields are hard coded specifically @@ -1325,6 +1326,7 @@ def __init__(self, **args): def original_object(self): return self.artin + ############################################################################# class HypergeometricMotiveLfunction(Lfunction): diff --git a/lmfdb/lfunctions/test_lfunctions.py b/lmfdb/lfunctions/test_lfunctions.py index a3341edc07..941b86f14b 100644 --- a/lmfdb/lfunctions/test_lfunctions.py +++ b/lmfdb/lfunctions/test_lfunctions.py @@ -2,6 +2,7 @@ from .LfunctionPlot import paintSvgFileAll from lmfdb.tests import LmfdbTest + class LfunctionTest(LmfdbTest): # All tests should pass diff --git a/lmfdb/maass_forms/templates/maass_browse_graph.html b/lmfdb/maass_forms/templates/maass_browse_graph.html index bf11d1993b..a5220e2105 100644 --- a/lmfdb/maass_forms/templates/maass_browse_graph.html +++ b/lmfdb/maass_forms/templates/maass_browse_graph.html @@ -4,7 +4,7 @@

Maass forms of levels {{min_level}} to {{max_level}} with ${{min_R}} \leq R\leq {{max_R}}$

- The horizontal axis is the {{KNOWL('mf.maass.mwf.spectralparameter', title='spectral parameter')}} $R$ with the {{KNOWL('mf.maass.mwf.eigenvalue', title='Laplace eigenvalue')}} satisying $\lambda=1/4+R^2$. The vertical axis is the {{KNOWL('mf.maass.mwf.level', title='level')}} $N$. Each point corresponds to a Maass form of {{KNOWL('mf.maass.mwf.weight', title='weight')}} 0 and trivial character on $\Gamma_0(N)$ with the color showing whether the {{KNOWL('mf.maass.mwf.symmetry', title='symmetry')}} is even or odd. + The horizontal axis is the {{KNOWL('mf.maass.mwf.spectralparameter', title='spectral parameter')}} $R$ with the {{KNOWL('mf.maass.mwf.eigenvalue', title='Laplace eigenvalue')}} satisfying $\lambda=1/4+R^2$. The vertical axis is the {{KNOWL('mf.maass.mwf.level', title='level')}} $N$. Each point corresponds to a Maass form of {{KNOWL('mf.maass.mwf.weight', title='weight')}} 0 and trivial character on $\Gamma_0(N)$ with the color showing whether the {{KNOWL('mf.maass.mwf.symmetry', title='symmetry')}} is even or odd.

In the plot below each dot is linked to the homepage of the corresponding {{KNOWL('mf.maass.mwf',title='Maass forms')}}.

diff --git a/lmfdb/maass_forms/web_maassform.py b/lmfdb/maass_forms/web_maassform.py index a6cfabefaf..5d1aeb5914 100644 --- a/lmfdb/maass_forms/web_maassform.py +++ b/lmfdb/maass_forms/web_maassform.py @@ -74,14 +74,14 @@ def rational_coeff_error_notation(factored_n): if not factored_n: # n = 1 return "1" for p, e in factored_n: - res *= (p**(e//2)) + res *= p**(e//2) res = 1./res res = str(res).rstrip('0') return res def coeff_error_notation(coeff, error, pm=False): - r"""Web coefficient and error display, with trunctation""" + r"""Web coefficient and error display, with truncation""" if error == -1: return r"\mathrm{unknown}" if pm: diff --git a/lmfdb/modular_curves/upload.py b/lmfdb/modular_curves/upload.py index 86fa9788f2..c7d941a2c9 100644 --- a/lmfdb/modular_curves/upload.py +++ b/lmfdb/modular_curves/upload.py @@ -36,7 +36,7 @@ class Points(UploadSection): UTextBox("curve", "Modular curve", "upload.modcurve.name_or_label", name_or_label_for="gps_gl2zhat_fine", label_linker=modcurve_link), UTextBox("residue_field", "Residue field", "upload.modcurve.residue_field", label_for="nf_fields", label_linker=lambda label: nf_display_knowl(label, label)), UTextBox("jorig", "$j$-invariant", "upload.modcurve.jinv", remove_spaces=True, re=(jre, "comma separated rationals"), mathmode=True), - UTextBox("coordinates", "Coordinates", "upload.modcurve.coordinates", remove_spaces=True, re=(coordre, "semicolon separated points, each point giving (weighted) projective coordinates sepatated by colons, with each coordinate specified as a comma separated list of rational numbers"), mathmode=True), + UTextBox("coordinates", "Coordinates", "upload.modcurve.coordinates", remove_spaces=True, re=(coordre, "semicolon separated points, each point giving (weighted) projective coordinates separated by colons, with each coordinate specified as a comma separated list of rational numbers"), mathmode=True), ModelTypeBox("model_type", "Model type"), USelectBox("isolated", "Isolated", "upload.modcurve.isolated", [("0", "Unknown"), @@ -142,7 +142,7 @@ def process(self, rec): # TODO: compute data["j_height"] # TODO: compute data["Elabel"], data["ainvs"], data["conductor_norm"] # TODO: compute data["cm"]; there should be good code for this in Sage - # BIG TODO: Propogate this point to other modular curves (both up and down, including fine models) + # BIG TODO: Propagate this point to other modular curves (both up and down, including fine models) return [("modcurve_points", True, data)] @lazy_attribute @@ -172,7 +172,7 @@ def process(self, rec): class GonalityBounds(UploadSection): name = "modcurve_gonality" title = "Gonality bounds" - intro = "To update gonality bounds for a single curve, enter it here; these bounds will be propogated to other modular curves." + intro = "To update gonality bounds for a single curve, enter it here; these bounds will be propagated to other modular curves." inputs = [UReferenceBox("reference", "Reference", "upload.reference"), UTextBox("curve", "Modular curve", "upload.modcurve.name_or_label", name_or_label_for="gps_gl2zhat_fine", label_linker=modcurve_link), UTextBox("q_gonality", r"$\mathbb{Q}$-gonality", "upload.modcurve.q_gonality", remove_spaces=True, natural_or_range=True), @@ -212,7 +212,7 @@ def validate(self, rec): def verify(self, rec): # TODO: If gonal map specified, we should confirm that its degree matches the provided upper gonality bound - # We don't do anything further here, since propogation is expensive and we want to wait until the processing stage + # We don't do anything further here, since propagation is expensive and we want to wait until the processing stage pass def process(self, rec): diff --git a/lmfdb/modular_curves/web_curve.py b/lmfdb/modular_curves/web_curve.py index 76d09261e6..cc33f9a35a 100644 --- a/lmfdb/modular_curves/web_curve.py +++ b/lmfdb/modular_curves/web_curve.py @@ -172,10 +172,10 @@ def formatted_newforms(newforms, mults): return ", ".join(f'{label}{showexp(c)}' for (label, c) in zip(newforms, mults)) def formatted_model_html(self, m): -#this is only for curves with models -#but not curves with self.has_more_models -#and also not for genus 0 cuves with points -#we need to somehow give this info + # this is only for curves with models + # but not curves with self.has_more_models + # and also not for genus 0 curves with points + # we need to somehow give this info eqn_threshold = 3 #this displays threshold - 1 lines to start eqns, lines, nb_var, typ, smooth = formatted_model_data(m) def title_of_model(self, lines, nb_var, typ, smooth): diff --git a/lmfdb/uploads/process.py b/lmfdb/uploads/process.py index c949322e50..ee81ebd9fa 100644 --- a/lmfdb/uploads/process.py +++ b/lmfdb/uploads/process.py @@ -54,7 +54,7 @@ def process_all(): timestamp = datetime.utcnow().isoformat() status_update[rec["section"]][rec["id"]] = (status, timestamp, comment) - # There are some sections (like gonality propogation) that want to do more + # There are some sections (like gonality propagation) that want to do more # processing after all inputs are known. By default, we use this function # just to write status_update to F for section_name, ids in status_update.items(): diff --git a/lmfdb/utils/display_stats.py b/lmfdb/utils/display_stats.py index de82fc2866..9a49aaf4e7 100644 --- a/lmfdb/utils/display_stats.py +++ b/lmfdb/utils/display_stats.py @@ -475,7 +475,7 @@ def display_data(self, cols, table=None, constraint=None, avg=None, - ``table`` -- a ``PostgresStatsTable`` - ``cols`` -- a list of column names - ``constraint`` -- a dictionary giving constraints on other columns. - Only rows satsifying those constraints are included in the counts. + Only rows satisfying those constraints are included in the counts. - ``avg`` -- whether to include the average value of cols[0] (cols must be of length 1 with no bucketing) - ``buckets`` -- a dictionary whose keys are columns, and whose values are lists of strings such as '5' or '2-7'. diff --git a/lmfdb/utils/downloader.py b/lmfdb/utils/downloader.py index cef39fd049..f2d2766843 100644 --- a/lmfdb/utils/downloader.py +++ b/lmfdb/utils/downloader.py @@ -584,7 +584,7 @@ def get_sort(self, info, query): """ This determines the sort order requested from the database. - OUPUT: + OUTPUT: - a list or other object appropriate for passing as the ``sort`` argument to the ``search`` method of the search table. diff --git a/lmfdb/utils/uploader.py b/lmfdb/utils/uploader.py index c0f6f98db0..07a665cc01 100644 --- a/lmfdb/utils/uploader.py +++ b/lmfdb/utils/uploader.py @@ -6,7 +6,7 @@ * An additional validation step is run on a server (anything that might take a nontrivial amount of computation). Entries passing this step are graduated to status 1; failures are marked with status -1. * Entries passing this step are checked by a human editor; acceptance earns status 2 and failure is marked with status -2. * Approved entries are then added to the appropriate table by another script run on a server (since this step may also involve nontrivial computation, like with gonality bounds). Entries passing this step are marked with status 3; failures with -3. A successful run of this step produces file(s) for use with copy_from on appropriate tables. -* Finally, a script executes copy_from. Failure here is unexpected and marked with -4 (due to failue in Postgres loading the file); success is marked with 4. +* Finally, a script executes copy_from. Failure here is unexpected and marked with -4 (due to failure in Postgres loading the file); success is marked with 4. * While in stage 0, 1 or 2, uploads can be withdrawn by the submitter. If so, they will be marked with status -5. """ @@ -209,6 +209,7 @@ class UploadSection(): inputs = [] offer_csv = True csv_template_url = None + def __init__(self, **kwds): for key, val in kwds.items(): setattr(self, key, val) @@ -218,7 +219,7 @@ def validate(self, rec): This function is called at input time when a user uploads data, performating basic validation but nothing that takes a long time. - Failure is immediately reported to the user who attemped to upload data. + Failure is immediately reported to the user who attempted to upload data. """ for box in self.inputs: rec[box.name] = box.validate(rec[box.name]) From 3c73fb415965ad3977f5e32114cc965d17219c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 2 Sep 2024 17:41:46 +0200 Subject: [PATCH 05/18] more typos --- lmfdb/ecnf/WebEllipticCurve.py | 2 +- lmfdb/utils/search_columns.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lmfdb/ecnf/WebEllipticCurve.py b/lmfdb/ecnf/WebEllipticCurve.py index 1aa169250e..2f04e8b2e4 100644 --- a/lmfdb/ecnf/WebEllipticCurve.py +++ b/lmfdb/ecnf/WebEllipticCurve.py @@ -718,7 +718,7 @@ def latex_kod(kod): # LMFDB labels: self.base_change_Q = [cremona_label_to_lmfdb_label(lab) for lab in self.base_change if '-' not in lab] - # sort by conductor (so also unkown curves come last) + # sort by conductor (so also unknown curves come last) self.base_change_Q.sort(key=lambda lab:ZZ(conductor_from_label(lab))) self.bcQtext = [] # for the Base change section of the home page for lab in self.base_change_Q: diff --git a/lmfdb/utils/search_columns.py b/lmfdb/utils/search_columns.py index 41238d439b..bb79312be5 100644 --- a/lmfdb/utils/search_columns.py +++ b/lmfdb/utils/search_columns.py @@ -367,7 +367,7 @@ def download(self, rec, name=None): class ProcessedLinkCol(ProcessedCol): """ - These columns allow for funtions to be applied to the contents retrieved from the database before generating + These columns allow for functions to be applied to the contents retrieved from the database before generating a link. They take three additional inputs: - ``url_func`` -- a function producing the url from the contents @@ -392,7 +392,7 @@ class MultiProcessedCol(SearchCol): - ``inputs`` -- a list of column names from the search table (or that have been created in a postprocessing step) - ``func`` -- a function taking as input the inputs from a given row and producing a value to be displayed - - ``apply_download`` -- either a boolean (determing whether the function should be applied when + - ``apply_download`` -- either a boolean (determining whether the function should be applied when downloading), or a function that is applied instead when downloading. Note that ``download_col`` is still available, and provides an alternative to the use of ``apply_download``. From 752b9ea7d8a29205ffcba37e4ed999b985a72227 Mon Sep 17 00:00:00 2001 From: edgarcosta Date: Mon, 2 Sep 2024 15:49:43 +0000 Subject: [PATCH 06/18] autopep8 action fixes --- lmfdb/modular_curves/web_curve.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lmfdb/modular_curves/web_curve.py b/lmfdb/modular_curves/web_curve.py index cc33f9a35a..8c6f1b7613 100644 --- a/lmfdb/modular_curves/web_curve.py +++ b/lmfdb/modular_curves/web_curve.py @@ -178,6 +178,7 @@ def formatted_model_html(self, m): # we need to somehow give this info eqn_threshold = 3 #this displays threshold - 1 lines to start eqns, lines, nb_var, typ, smooth = formatted_model_data(m) + def title_of_model(self, lines, nb_var, typ, smooth): if typ == 0: title = display_knowl('ag.canonical_model', 'Canonical model') +\ @@ -209,6 +210,7 @@ def title_of_model(self, lines, nb_var, typ, smooth): elif typ == 8: return display_knowl('modcurve.embedded_model', 'Embedded model') +\ r" Embedded model in $\mathbb{P}^{%d}$" % (nb_var-1,) + def equation_of_model(lines, typ): table = '
'+\ ''+\ From ea359b87a829c36b7d453d72d3e67ca8404d3ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 2 Sep 2024 20:09:30 +0200 Subject: [PATCH 07/18] fix pycodestyle E111 and E222 --- lmfdb/elliptic_curves/elliptic_curve.py | 23 ++++++++++++----------- lmfdb/elliptic_curves/web_ec.py | 2 +- lmfdb/groups/abstract/main.py | 4 ++-- lmfdb/groups/abstract/verify.py | 20 ++++++++++---------- lmfdb/groups/abstract/web_groups.py | 21 ++++++++++----------- lmfdb/modl_galois_representations/main.py | 5 ++++- lmfdb/modular_curves/web_curve.py | 2 +- 7 files changed, 40 insertions(+), 37 deletions(-) diff --git a/lmfdb/elliptic_curves/elliptic_curve.py b/lmfdb/elliptic_curves/elliptic_curve.py index 14eb87b237..5037fb97ae 100644 --- a/lmfdb/elliptic_curves/elliptic_curve.py +++ b/lmfdb/elliptic_curves/elliptic_curve.py @@ -764,21 +764,22 @@ def render_curve_webpage_by_label(label): code = data.code() code['show'] = {'magma':'','pari':'','sage':'','oscar':''} # use default show names learnmore_curve_picture = ('Picture description', url_for(".curve_picture_page")) - T = render_template("ec-curve.html", - properties=data.properties, - data=data, - # set default show names but actually code snippets are filled in only when needed - code=code, - bread=data.bread, title=data.title, - friends=data.friends, - downloads=data.downloads, - KNOWL_ID="ec.q.%s"%lmfdb_label, - BACKUP_KNOWL_ID="ec.q.%s"%data.lmfdb_iso, - learnmore=learnmore_list_add(*learnmore_curve_picture)) + T = render_template("ec-curve.html", + properties=data.properties, + data=data, + # set default show names but actually code snippets are filled in only when needed + code=code, + bread=data.bread, title=data.title, + friends=data.friends, + downloads=data.downloads, + KNOWL_ID="ec.q.%s"%lmfdb_label, + BACKUP_KNOWL_ID="ec.q.%s"%data.lmfdb_iso, + learnmore=learnmore_list_add(*learnmore_curve_picture)) ec_logger.debug("Total walltime: %ss"%(time.time() - t0)) ec_logger.debug("Total cputime: %ss"%(cputime(cpt0))) return T + @ec_page.route("/data/
'+na_text() - # Otherwise we should have what we need [r1,r2] = self.signature() - reg = self.regulator() - h = self.class_number() w = self.root_of_1_order() r1term= r'2^{%s}\cdot'% r1 r2term= r'(2\pi)^{%s}\cdot'% r2 disc = ZZ(self._data['disc_abs']) + approx1 = r'= \mathstrut &' + if not self.haskey('class_group'): + ltx = r'%s\frac{%s%s %s \cdot %s}{%s\cdot\sqrt{%s}}'%(approx1,r1term,r2term,'R','h',w,disc) + return ltx+r'\cr\mathstrut & \text{ some values not computed }' + # Otherwise we should have what we need + reg = self.regulator() + h = self.class_number() approx1 = r'\approx' if self.unit_rank()>0 else r'=' approx1 += r"\mathstrut &" ltx = r'%s\frac{%s%s %s \cdot %s}{%s\cdot\sqrt{%s}}'%(approx1,r1term,r2term,str(reg),h,w,disc) @@ -869,6 +871,11 @@ def can_class_number(self): return True return False + def relh(self): + if self.haskey('relative_class_number'): + return self._data['relative_class_number'] + return dnc + def is_null(self): return self._data is None From 60582aa266290c46692a6ce14cbfe0ade37d6cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Tue, 3 Sep 2024 07:19:12 +0200 Subject: [PATCH 09/18] activate the check for E111 --- lmfdb/belyi/main.py | 6 ++++-- lmfdb/characters/web_character.py | 8 ++++++-- lmfdb/hypergm/test_hgm.py | 9 +++++---- lmfdb/modular_curves/main.py | 4 ++-- tox.ini | 2 +- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/lmfdb/belyi/main.py b/lmfdb/belyi/main.py index 6cc69ce703..b3d4a6b5da 100644 --- a/lmfdb/belyi/main.py +++ b/lmfdb/belyi/main.py @@ -683,6 +683,7 @@ def query_convert_abc_list(query): query.pop("abc_list") return query + def common_parse(info, query): parse_bracketed_posints(info, query, "abc_list", "a, b, c", maxlength=3) query_convert_abc_list(query) @@ -700,8 +701,9 @@ def common_parse(info, query): parse_nf_string(info, query, 'field', name="base number field", qfield='base_field_label') parse_bool(info, query, "is_primitive", name="is_primitive") for fld in ["geomtype", "group"]: - if info.get(fld): - query[fld] = info[fld] + if info.get(fld): + query[fld] = info[fld] + def primitivization_search(info, query, search_type): if search_type == "galmap": diff --git a/lmfdb/characters/web_character.py b/lmfdb/characters/web_character.py index 33d84defaf..ec99572176 100644 --- a/lmfdb/characters/web_character.py +++ b/lmfdb/characters/web_character.py @@ -59,15 +59,19 @@ from lmfdb.groups.abstract.main import abstract_group_display_knowl logger = make_logger("DC") + def parity_string(n): return ("even" if n else "odd") if isinstance(n, bool) else ("odd" if n == -1 else "even") + def bool_string(b): return "yes" if b else "no" + def compute_values(chi, groupelts): - "Helper function to compute values of several elements on the fly" - return [[k, int(chi.conreyangle(k) * chi.order)] for k in groupelts] + "Helper function to compute values of several elements on the fly" + return [[k, int(chi.conreyangle(k) * chi.order)] for k in groupelts] + def valuefield_from_order(order): order2 = order if order % 4 != 2 else order / 2 diff --git a/lmfdb/hypergm/test_hgm.py b/lmfdb/hypergm/test_hgm.py index 6ccc58176f..b5f43bcc48 100644 --- a/lmfdb/hypergm/test_hgm.py +++ b/lmfdb/hypergm/test_hgm.py @@ -1,13 +1,14 @@ from lmfdb.tests import LmfdbTest + class HGMTest(LmfdbTest): # TODO: create stats page - #def test_stats(self): - #self.check_args("Hypergeometric/Q/stats", "Monodromy") + # def test_stats(self): + # self.check_args("Hypergeometric/Q/stats", "Monodromy") - ### test pages + # test pages - ### family pages + # family pages def test_random_family(self): self.check_args("/Motive/Hypergeometric/Q/random_family", ["Hypergeometric motive family", "Defining parameters"]) diff --git a/lmfdb/modular_curves/main.py b/lmfdb/modular_curves/main.py index cbe3c56ca9..7934bb69f7 100644 --- a/lmfdb/modular_curves/main.py +++ b/lmfdb/modular_curves/main.py @@ -641,8 +641,8 @@ def modcurve_Gassmann_download(request, lang): print("info query = ", info["query"]) info["results"] = [] for i in range(ncurves): - query_dict.update({'coarse_num' : i+1}) - info["results"].append(db.gps_gl2zhat_fine.lucky(query_dict)) + query_dict.update({'coarse_num' : i+1}) + info["results"].append(db.gps_gl2zhat_fine.lucky(query_dict)) info["search_table"] = db.gps_gl2zhat_fine info["columns"] = modcurve_columns info["showcol"] = ".".join(["CPlabel", "RSZBlabel", "RZBlabel", "SZlabel", "Slabel", "rank", "cusps", "conductor", "simple", "squarefree", "decomposition", "models", "j-points", "local obstruction", "generators"]) diff --git a/tox.ini b/tox.ini index 907a4ade0d..67f280aced 100644 --- a/tox.ini +++ b/tox.ini @@ -30,4 +30,4 @@ commands = # E111 indentation is not a multiple of four # E702 multiple statements on one line (semicolon) # W391 blank line at end of file - pycodestyle --select=E722,E711,E702 lmfdb/ + pycodestyle --select=E111,E722,E711,E702 lmfdb/ From 4e953dff6a65ce61c9c92f3a8a998ca11bbfc7cc Mon Sep 17 00:00:00 2001 From: David Roe Date: Wed, 4 Sep 2024 02:47:57 -0400 Subject: [PATCH 10/18] Fix download input at top and bottom of search results --- lmfdb/static/lmfdb.js | 12 ++++++------ lmfdb/templates/download_search_results.html | 17 ++++++++++------- .../dummy_download_search_results.html | 8 ++++---- lmfdb/templates/matches.html | 1 + lmfdb/templates/style.css | 2 +- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/lmfdb/static/lmfdb.js b/lmfdb/static/lmfdb.js index a58decf81d..11c5cc8316 100644 --- a/lmfdb/static/lmfdb.js +++ b/lmfdb/static/lmfdb.js @@ -355,7 +355,7 @@ function increase_start_by_count_and_submit_form() { function get_count_of_results() { var address = window.location.href; $("#result-count").html("computing..."); - $("#download-msg").html("Computing number of results..."); + $("span.download-msg").html("Computing number of results..."); if (address.slice(-1) === "#") address = address.slice(0,-1); address += "&result_count=1"; @@ -365,8 +365,8 @@ function get_count_of_results() { function get_count_callback(res) { $('#result-count').html(res['nres']); $('#result-count2').html(res['nres']); - $("#download-msg").html(""); - $("#download-form").show(); + $("span.download-msg").html(""); + $("span.download-form").show(); }; /** @@ -574,7 +574,7 @@ function control_sort(S) { S.selectedIndex = -1; }; -function update_download_url(link) { +function update_download_url(link, downid) { // console.log("before modification", link.href); var newval; var url = new URL(link.href); @@ -588,12 +588,12 @@ function update_download_url(link) { params.set(keys[i], newval); } } - newval = $("input[name=download_row_count]").val(); + newval = $("input[name=download_row_count"+downid+"]").val(); console.log("newval", newval); if (newval.length > 0 && newval != "all") { params.set("download_row_count", newval); } - newval = $('#downlang-select').find(":selected").val(); + newval = $('#downlang-select'+downid).find(":selected").val(); params.set("Submit", newval); url.search = params.toString(); link.href = url.href; diff --git a/lmfdb/templates/download_search_results.html b/lmfdb/templates/download_search_results.html index 007124ad22..36f3b6a2ba 100644 --- a/lmfdb/templates/download_search_results.html +++ b/lmfdb/templates/download_search_results.html @@ -2,21 +2,24 @@ {% if not languages %} {% set languages = ['text', 'gp', 'sage', 'magma', 'oscar', 'csv'] %} {% endif %} +{% if not downid %} +{% set downid = 1 %} {# set externally so that we can distinguish in js between the download spans at the top and bottom of the results +{% endif %}   {% if info.exact_count %} - + {% else %} - + To download results, determine the number of results. -