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/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/artin_representations/math_classes.py b/lmfdb/artin_representations/math_classes.py index 5a1bb7014e..e2ae814050 100644 --- a/lmfdb/artin_representations/math_classes.py +++ b/lmfdb/artin_representations/math_classes.py @@ -158,7 +158,7 @@ def determinant(self): wc = thischar.split(r'.') self._data['central_character'] = WebSmallDirichletCharacter(modulus=wc[0], number=wc[1]) return self._data['central_character'] - return(thischar) + return thischar # Not in the database if self.dimension() == 1: return self.central_character() 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/classical_modular_forms/test_cmf.py b/lmfdb/classical_modular_forms/test_cmf.py index 3a4d572ae8..4b157a540e 100644 --- a/lmfdb/classical_modular_forms/test_cmf.py +++ b/lmfdb/classical_modular_forms/test_cmf.py @@ -7,7 +7,7 @@ class CmfTest(LmfdbTest): - def runTest(): + def runTest(self): pass def test_expression_divides(self): diff --git a/lmfdb/classical_modular_forms/test_cmf2.py b/lmfdb/classical_modular_forms/test_cmf2.py index 51a8b41b0b..76d6fc1d21 100644 --- a/lmfdb/classical_modular_forms/test_cmf2.py +++ b/lmfdb/classical_modular_forms/test_cmf2.py @@ -6,7 +6,7 @@ class CmfTest(LmfdbTest): - def runTest(): + def runTest(self): pass def test_download_qexp(self): diff --git a/lmfdb/ecnf/WebEllipticCurve.py b/lmfdb/ecnf/WebEllipticCurve.py index 1aa169250e..108168cd97 100644 --- a/lmfdb/ecnf/WebEllipticCurve.py +++ b/lmfdb/ecnf/WebEllipticCurve.py @@ -176,8 +176,10 @@ def inflate_interval(a,b,r): d*=r return (c-d,c+d) -def plot_zone_union(R,S): - return(min(R[0],S[0]),max(R[1],S[1]),min(R[2],S[2]),max(R[3],S[3])) + +def plot_zone_union(R, S): + return (min(R[0], S[0]), max(R[1], S[1]), min(R[2], S[2]), max(R[3], S[3])) + # Finds a suitable plotting zone for the component a <= x <= b of the EC y**2+h(x)*y=f(x) def EC_R_plot_zone_piece(f,h,a,b): @@ -718,7 +720,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/ecnf/ecnf_test_pages.py b/lmfdb/ecnf/ecnf_test_pages.py index 94b42f74e2..462ae39f55 100644 --- a/lmfdb/ecnf/ecnf_test_pages.py +++ b/lmfdb/ecnf/ecnf_test_pages.py @@ -2,9 +2,10 @@ from lmfdb.tests import LmfdbTest from lmfdb import db + class ECNFTest(LmfdbTest): - def runTest(): + def runTest(self): pass def test_d6_pages(self): diff --git a/lmfdb/elliptic_curves/code.yaml b/lmfdb/elliptic_curves/code.yaml index 820de91731..741888df34 100644 --- a/lmfdb/elliptic_curves/code.yaml +++ b/lmfdb/elliptic_curves/code.yaml @@ -157,7 +157,7 @@ bsd_formula: omega = E.period_lattice().omega(); reg = E.regulator(); tam = E.tamagawa_product(); tor = E.torsion_order(); assert r == ar; print("analytic sha: " + str(RR(Lr1) * tor^2 / (omega * reg * tam))) magma: | - /* self-contained Magma code snippet for the BSD formula (checks rank, computes analyiic sha) */ + /* self-contained Magma code snippet for the BSD formula (checks rank, computes analytic sha) */ E := EllipticCurve(%s); r := Rank(E); ar,Lr1 := AnalyticRank(E: Precision := 12); assert r eq ar; sha := MordellWeilShaInformation(E); omega := RealPeriod(E) * (Discriminant(E) gt 0 select 2 else 1); reg := Regulator(E); tam := &*TamagawaNumbers(E); tor := #TorsionSubgroup(E); 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/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/