diff --git a/CONTRIBUTORS.yaml b/CONTRIBUTORS.yaml index 52f56fb5d7..6777d5dd61 100644 --- a/CONTRIBUTORS.yaml +++ b/CONTRIBUTORS.yaml @@ -27,7 +27,7 @@ affil: Dartmouth College name: Salman Baig --- name: Jennifer Balakrishnan -url: http://math.bu.edu/people/jbala/ +url: https://math.bu.edu/people/jbala/ affil: Boston University --- name: Alex Bartel @@ -35,7 +35,7 @@ url: https://www.gla.ac.uk/schools/mathematicsstatistics/staff/alexbartel/ affil: University of Glasgow --- name: Jennifer Beineke -url: http://mars.wne.edu/~jbeineke/ +url: https://mars.wne.edu/~jbeineke/ affil: Western New England College --- name: Alex J. Best @@ -43,7 +43,7 @@ url: https://alexjbest.github.io/ affil: Boston University --- name: Jonathan W. Bober -url: http://sage.math.washington.edu/home/bober/www/ +url: https://sage.math.washington.edu/home/bober/www/ affil: University of Bristol --- name: Raymond van Bommel @@ -52,7 +52,7 @@ url: https://www.raymondvanbommel.nl/ --- name: Andrew Booker affil: University of Bristol -url: http://www.maths.bris.ac.uk/people/faculty/maarb/ +url: https://www.maths.bris.ac.uk/people/faculty/maarb/ --- name: Robert Bradshaw affil: Google Inc. @@ -66,10 +66,10 @@ affil: Dartmouth College --- name: Peter Bruin affil: Universiteit Leiden -url: http://pub.math.leidenuniv.nl/~bruinpj/ +url: https://pub.math.leidenuniv.nl/~bruinpj/ --- name: Alina Bucur -url: http://www.math.ucsd.edu/~alina/ +url: https://www.math.ucsd.edu/~alina/ affil: University of California, San Diego --- name: Sarunas Burdulis @@ -91,27 +91,27 @@ name: Fabien Clery affil: Loughborough University --- name: Henri Cohen -url: http://www.math.u-bordeaux1.fr/~hecohen/ +url: https://www.math.u-bordeaux1.fr/~hecohen/ affil: University Bordeaux I --- name: Brian Conrey affil: University of Bristol and AIM -url: http://www.aimath.org/conrey/ +url: https://www.aimath.org/conrey/ --- name: Lewis Combes affil: University of Sheffield --- name: Edgar Costa affil: MIT -url: https://math.mit.edu/~edgarc/ +url: https://edgarcosta.org --- name: John Cremona affil: University of Warwick -url: http://www2.warwick.ac.uk/fac/sci/maths/people/staff/john_cremona/ +url: https://www2.warwick.ac.uk/fac/sci/maths/people/staff/john_cremona/ --- name: Rachel Davis affil: Purdue University -url: http://www.math.purdue.edu/~davis705 +url: https://www.math.purdue.edu/~davis705 --- name: Paul-Olivier Dehaye url: https://paulolivier.dehaye.org/ @@ -125,7 +125,7 @@ url: https://wwwen.uni.lu/research/fstm/dmath/people/lassina_dembele affil: Université du Luxembourg --- name: Maarten Derickx -url: http://www.mderickx.nl +url: https://www.mderickx.nl email: maarten@mderickx.nl affil: Universiteit Leiden --- @@ -134,11 +134,11 @@ affil: Kings College London url: https://nms.kcl.ac.uk/martin.dickson/ --- name: Tim Dokchitser -url: http://www.maths.bris.ac.uk/~matyd/ +url: https://www.maths.bris.ac.uk/~matyd/ affil: University of Bristol --- name: Taylor Dupuy -url: http://www.uvm.edu/~tdupuy/ +url: https://www.uvm.edu/~tdupuy/ affil: University of Vermont email: taylor.dupuy@uvm.edu --- @@ -146,7 +146,7 @@ name: Bas Edixhoven affil: Universiteit Leiden --- name: Stephan Ehlen -url: http://www.stephanehlen.de +url: https://www.stephanehlen.de affil: Universität zu Köln --- name: David W. Farmer @@ -161,15 +161,15 @@ email: markus.fraczek@gmail.com --- name: Sharon Frechette affil: College of Holy Cross -url: http://mathcs.holycross.edu/~sfrechet/ +url: https://mathcs.holycross.edu/~sfrechet/ --- name: Ralph Furmaniak affil: Stanford University -url: http://stanford.edu/~rfurman/ +url: https://stanford.edu/~rfurman/ --- name: Enrique González Jiménez affil: Universidad Autonóma de Madrid -url: http://www.uam.es/personal_pdi/ciencias/engonz/ +url: https://www.uam.es/personal_pdi/ciencias/engonz/ --- name: Thomas Grubb affil: University of California, San Diego @@ -177,14 +177,14 @@ url: https://www.math.ucsd.edu/~tgrubb/ --- name: Paul E. Gunnells affil: University of Massachusetts Amherst -url: http://people.math.umass.edu/~gunnells/ +url: https://people.math.umass.edu/~gunnells/ --- name: Anna Haensch affil: Duquesne University -url: http://www.mathcs.duq.edu/~haensch/ +url: https://www.mathcs.duq.edu/~haensch/ --- name: Jonathan Hanke -url: http://www.wordpress.jonhanke.com/ +url: https://www.wordpress.jonhanke.com/ --- name: William Hart affil: Technische Universität Kaiserslautern @@ -194,7 +194,7 @@ affil: The Ohio State University url: https://people.math.osu.edu/hiary.1/ --- name: Duc Khiem Huynh -url: http://www.math.uwaterloo.ca/~dkhuynh/ +url: https://www.math.uwaterloo.ca/~dkhuynh/ affil: University of Waterloo --- name: John Jones @@ -203,10 +203,10 @@ affil: Arizona State University --- name: Jon Keating affil: University of Bristol -url: http://www.maths.bris.ac.uk/people/profile/majpk +url: https://www.maths.bris.ac.uk/people/profile/majpk --- name: Kiran S. Kedlaya -url: http://kskedlaya.org/ +url: https://kskedlaya.org/ affil: University of California, San Diego --- name: Kamal Khuri-Makdisi @@ -222,14 +222,14 @@ name: Watson Ladd affil: University of California --- name: Anthony Lazzaro -url: http://skynab.net/ +url: https://skynab.net/ --- name: Stefan Lemurell -url: http://www.math.chalmers.se/~sj/ +url: https://www.math.chalmers.se/~sj/ affil: Göteborgs Universitet --- name: David Lowry-Duda -url: http://davidlowryduda.com/ +url: https://davidlowryduda.com/ affil: Brown University --- name: Lex Martin @@ -248,17 +248,17 @@ name: Anna Medvedovsky affil: MPI Bonn --- name: Robert Miller -url: http://www.rlmiller.org/ +url: https://www.rlmiller.org/ --- name: Andreea Mocanu affil: University of Nottingham --- name: Pascal Molin -url: http://www.math.jussieu.fr/~molinp/ +url: https://www.math.jussieu.fr/~molinp/ affil: Université Paris 7 --- name: Grant Molnar -url: http://www.grantmolnar.com +url: https://www.grantmolnar.com --- name: Warren Moore email: warrenmoore30@yahoo.co.uk @@ -275,25 +275,25 @@ name: Nhi Ngo affil: Grinnell College --- name: Aurel Page -url: http://www.normalesup.org/~page/index-en.html +url: https://www.normalesup.org/~page/index-en.html email: aurel.page@normalesup.org affil: University of Bordeaux --- name: Jennifer Paulhus affil: Grinnell College -url: http://www.math.grinnell.edu/~paulhusj/ +url: https://www.math.grinnell.edu/~paulhusj/ --- name: David Platt affil: University of Bristol -url: http://www.maths.bris.ac.uk/~madjp/ +url: https://www.maths.bris.ac.uk/~madjp/ --- name: Robert Pollack affil: Boston University -url: http://math.bu.edu/people/rpollack/ +url: https://math.bu.edu/people/rpollack/ --- name: Alexander D. Rahm affil: University of Luxembourg -url: http://math.uni.lu/~rahm +url: https://math.uni.lu/~rahm --- name: Heather Ratcliffe affil: University of Warwick @@ -304,7 +304,7 @@ name: Rishikesh --- name: David Roberts affil: University of Minnesota, Morris -url: http://cda.mrs.umn.edu/~roberts/index.html +url: https://cda.mrs.umn.edu/~roberts/index.html --- name: Fernando Rodriguez Villegas affil: ICTP, Trieste @@ -315,11 +315,11 @@ affil: Fordham University url: https://faculty.fordham.edu/mroy17/ --- name: Michael Rubinstein -url: http://www.math.uwaterloo.ca/~mrubinst/ +url: https://www.math.uwaterloo.ca/~mrubinst/ affil: University of Waterloo --- name: Nathan Ryan -url: http://www.eg.bucknell.edu/~ncr006/ +url: https://www.eg.bucknell.edu/~ncr006/ affil: Bucknell University --- name: George J. Schaeffer @@ -335,13 +335,13 @@ url: https://math.dartmouth.edu/~samschiavone/ affil: Dartmouth College --- name: Harald Schilly -url: http://harald.schil.ly +url: https://harald.schil.ly email: harald@schil.ly affil: University of Vienna location: Vienna, Austria --- name: Ralf Schmidt -url: http://www2.math.ou.edu/~rschmidt/ +url: https://www2.math.ou.edu/~rschmidt/ affil: University of Oklahoma --- name: Gagan Sekhon @@ -352,7 +352,7 @@ url: https://sites.google.com/site/mhaluksengun/ --- name: Jerry Shurman affil: Reed College -url: http://people.reed.edu/~jerry/ +url: https://people.reed.edu/~jerry/ --- name: Jeroen Sijsling affil: Universität Ulm @@ -360,21 +360,21 @@ url: https://jrsijsling.eu/ --- name: Samir Siksek affil: University of Warwick -url: http://homepages.warwick.ac.uk/staff/S.Siksek/ +url: https://homepages.warwick.ac.uk/staff/S.Siksek/ --- name: Joseph Silverman affil: Brown University -url: http://www.math.brown.edu/~jhs/ +url: https://www.math.brown.edu/~jhs/ --- name: Nils-Peter Skoruppa -url: http://www.nskoruppa.de/ +url: https://www.nskoruppa.de/ affil: Universität Siegen --- name: William Stein -url: http://wstein.org/ +url: https://wstein.org/ affil: University of Washington notes: - - Creator of SageMath + - Creator of SageMath --- name: Fredrik Strömberg affil: University of Nottingham @@ -384,7 +384,7 @@ name: Sanah Suri affil: Grinnell College --- name: Andrew Sutherland -url: http://math.mit.edu/~drew +url: https://math.mit.edu/~drew email: drew@math.mit.edu affil: MIT --- @@ -393,11 +393,11 @@ url: https://sites.google.com/view/hollyswisher/home affil: Oregon State University --- name: Gonzalo Tornaria -url: http://www.cmat.edu.uy/~tornaria/ +url: https://www.cmat.edu.uy/~tornaria/ affil: Universidad de la República, Uruguay --- name: Holger Then -url: http://www.maths.bris.ac.uk/~mahlt/ +url: https://www.maths.bris.ac.uk/~mahlt/ affil: University of Bristol --- name: Alex Torzewski @@ -407,7 +407,7 @@ url: https://www.kcl.ac.uk/people/alex-torzewski name: Christelle Vincent affil: University of Vermont email: christelle.vincent@uvm.edu -url: http://www.uvm.edu/~cvincen1/ +url: https://www.uvm.edu/~cvincen1/ --- name: John Voight url: https://www.math.dartmouth.edu/~jvoight @@ -415,14 +415,14 @@ affil: Dartmouth College --- name: Lynne Walling affil: University of Bristol -url: http://www.maths.bris.ac.uk/people/profile/malhw +url: https://www.maths.bris.ac.uk/people/profile/malhw --- name: Mark Watkins affil: University of Sydney -url: http://magma.maths.usyd.edu.au/~watkins/ +url: https://magma.maths.usyd.edu.au/~watkins/ --- name: David Watson -url: http://emps.exeter.ac.uk/mathematics/staff/dw387 +url: https://emps.exeter.ac.uk/mathematics/staff/dw387 affil: University of Exeter --- name: Kevin Wang @@ -433,14 +433,14 @@ affil: Purdue University --- name: Trevor Wooley affil: University of Bristol -url: http://www.maths.bris.ac.uk/people/profile/matdw +url: https://www.maths.bris.ac.uk/people/profile/matdw --- name: Dan Yasaki -url: http://www.uncg.edu/~d_yasaki/ +url: https://www.uncg.edu/~d_yasaki/ email: d_yasaki@uncg.edu affil: The University of North Carolina Greensboro --- name: David Yuen affil: Lake Forest College -url: http://www.lakeforest.edu/academics/faculty/yuen/ +url: https://www.lakeforest.edu/academics/faculty/yuen/ diff --git a/Development.md b/Development.md index 0e723cfd24..d83ddfa7d9 100644 --- a/Development.md +++ b/Development.md @@ -329,8 +329,8 @@ and knowledge/main.py. Also, templates and static files specific to the module should be in their respective "templates" and "static" folders, e.g. /knowledge/templates/. -[1] http://docs.python.org/tutorial/modules.html -[2] http://flask.pocoo.org/docs/blueprints/ +[1] https://docs.python.org/tutorial/modules.html +[2] https://flask.pocoo.org/docs/blueprints/ Code Attribution @@ -465,7 +465,7 @@ This is in the `hooks/post-receive` in the bare Git repo: ``` #!/bin/sh # update the lmfdb-git-beta or -prod server depending on the branch -# this is based on http://stackoverflow.com/a/13057643/54236 +# this is based on https://stackoverflow.com/a/13057643/54236 restart() { echo "updating $1" diff --git a/GettingStarted.md b/GettingStarted.md index f22047cfb3..5f0800305c 100644 --- a/GettingStarted.md +++ b/GettingStarted.md @@ -14,14 +14,14 @@ Installation * Make sure you have a recent version of Sage installed (at least running on Python 3) and that `sage` is available from the commandline. In particular see - [Sage installation](http://doc.sagemath.org/html/en/installation/source.html). + [Sage installation](https://doc.sagemath.org/html/en/installation/source.html). Also check that your version of Sage has ssl available by checking that `import ssl` works on its command line. If not, then the `pip install` commands below will fail. To remedy this, either install SSL globally on your system or have Sage build its own local version, as mentioned - [here](http://doc.sagemath.org/html/en/installation/source.html#notebook-additional-features) + [here](https://doc.sagemath.org/html/en/installation/source.html#notebook-additional-features) and - [here](http://doc.sagemath.org/html/en/installation/source.html#building-the-notebook-with-ssl-support), + [here](https://doc.sagemath.org/html/en/installation/source.html#building-the-notebook-with-ssl-support), respectively. * Install dependencies. This requires you to have write access to the @@ -281,13 +281,13 @@ LMFDB On Windows We do not recommend attempting to run LMFDB from within the Sage virtual image. For anyone who would like to attempt it, the following steps should theoretically work. - * Download `VirtualBox` and the Sage appliance, following the instructions [here](http://wiki.sagemath.org/SageAppliance). + * Download `VirtualBox` and the Sage appliance, following the instructions [here](https://wiki.sagemath.org/SageAppliance). * The default Sage appliance does not have enough space to install LMFDB's prerequisites. Moreover, the default file type (vmdk) installed by `VirtualBox` does not support resizing. You will need to increase the available space by cloning into a vdi file, increasing the space and cloning back, following the - instructions [here](http://stackoverflow.com/questions/11659005/how-to-resize-a-virtualbox-vmdk-file) and - [here](http://www.howtogeek.com/124622/how-to-enlarge-a-virtual-machines-disk-in-virtualbox-or-vmware/). We had + instructions [here](https://stackoverflow.com/questions/11659005/how-to-resize-a-virtualbox-vmdk-file) and + [here](https://www.howtogeek.com/124622/how-to-enlarge-a-virtual-machines-disk-in-virtualbox-or-vmware/). We had trouble at this stage: make sure to keep the .ova file in case you screw up your virtual image. * The resulting disk image needs to be repartitioned to make the space available. Unfortunately, the Sage appliance @@ -299,7 +299,7 @@ For anyone who would like to attempt it, the following steps should theoreticall See Section 6.3.1 [here](https://www.virtualbox.org/manual/ch06.html). * Clone the LMFDB git repository into your host OS, and set up shared folders so that you can access - the LMFDB code from within the Sage appliance. See the [Sage instructions](http://wiki.sagemath.org/SageAppliance) for how to share folders. + the LMFDB code from within the Sage appliance. See the [Sage instructions](https://wiki.sagemath.org/SageAppliance) for how to share folders. * Now you need to run ssh-keygen within the Sage appliance and e-mail the result to Harald Schilly, Jonathan Bober or John Cremona (see above). Since copy-and-paste can be tricky from inside the virtual image, we suggest writing to a file shared by the host OS. diff --git a/Postgres_FAQ.md b/Postgres_FAQ.md index 3c817aa4e5..6cf3043d0a 100644 --- a/Postgres_FAQ.md +++ b/Postgres_FAQ.md @@ -539,7 +539,7 @@ Statistics One purpose of statistics is to inform viewers of the website of the extent of the data. Many sections of the lmfdb have statistics pages for this purpose (e.g. [number field - statistics](http://www.lmfdb.org/NumberField/stats)). Each table + statistics](https://www.lmfdb.org/NumberField/stats)). Each table has an attached statistics object (e.g. `db.nf_fields.stats`) with methods to support the collection of and access to statistics on the table. diff --git a/README.md b/README.md index 57aee45270..5918384d96 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ============== This is the code for the -[L-functions and modular forms database website](http://www.lmfdb.org/). +[L-functions and modular forms database website](https://www.lmfdb.org/). Wiki ---- diff --git a/lmfdb/abvar/fq/main.py b/lmfdb/abvar/fq/main.py index 3f569a3a6d..dcb6cb458e 100644 --- a/lmfdb/abvar/fq/main.py +++ b/lmfdb/abvar/fq/main.py @@ -35,8 +35,7 @@ def get_bread(*breads): ("Abelian varieties", url_for(".abelian_varieties")), ("Fq", url_for(".abelian_varieties")), ] - for z in breads: - bc.append(z) + bc.extend(z for z in breads) return bc def learnmore_list(): diff --git a/lmfdb/abvar/fq/stats.py b/lmfdb/abvar/fq/stats.py index 19647afa4b..ad17e8b400 100644 --- a/lmfdb/abvar/fq/stats.py +++ b/lmfdb/abvar/fq/stats.py @@ -7,6 +7,7 @@ from lmfdb.backend.utils import range_formatter from lmfdb.logger import make_logger from sage.misc.lazy_attribute import lazy_attribute +from sage.misc.cachefunc import cached_method logger = make_logger("abvarfq") def yn(t): @@ -172,17 +173,17 @@ def dynamic_parse(info, query): dynamic_parent_page = "abvarfq-refine-search.html" dynamic_cols = ["q", "g", "p_rank", "angle_rank", "size", "geometric_extension_degree", "jacobian_count", "hyp_count", "twist_count", "max_twist_degree", "is_simple", "is_geometrically_simple", "is_primitive", "has_jacobian", "has_principal_polarization", "jacobian_count", "hyp_count"] - @lazy_attribute + @cached_method def _counts(self): return db.av_fq_isog.stats.column_counts(["g", "q"]) @lazy_attribute def qs(self): - return sorted({q for g, q in self._counts}) + return sorted({q for g, q in self._counts()}) @lazy_attribute def gs(self): - return sorted({g for g, q in self._counts}) + return sorted({g for g, q in self._counts()}) @lazy_attribute def isogeny_knowl(self): @@ -216,22 +217,22 @@ def summary(self): @lazy_attribute def counts(self): counts = {} - counts["nclasses"] = ncurves = sum(self._counts.values()) + counts["nclasses"] = ncurves = sum(self._counts().values()) counts["nclasses_c"] = comma(ncurves) counts["gs"] = self.gs counts["qs"] = self.qs counts["qg_count"] = defaultdict(lambda: defaultdict(int)) - for (g, q), cnt in self._counts.items(): + for (g, q), cnt in self._counts().items(): counts["qg_count"][q][g] = cnt return counts @lazy_attribute def maxq(self): - return {g: max(q for gg, q in self._counts if g == gg) for g in self.gs} + return {g: max(q for gg, q in self._counts() if g == gg) for g in self.gs} @lazy_attribute def maxg(self): - maxg = {q: max(g for g, qq in self._counts if q == qq) for q in self.qs} + maxg = {q: max(g for g, qq in self._counts() if q == qq) for q in self.qs} # maxg[None] used in decomposition search maxg[None] = max(self.gs) return maxg diff --git a/lmfdb/app.py b/lmfdb/app.py index fd0abda3c4..973ded7240 100644 --- a/lmfdb/app.py +++ b/lmfdb/app.py @@ -317,6 +317,9 @@ def bad_bots_list(): "The Knowledge AI", "Wolfram", "petalbot", + "Bytespider", + "Sogou", + "MJ12bot", ] ] diff --git a/lmfdb/artin_representations/main.py b/lmfdb/artin_representations/main.py index eebcc2106b..5f76b85f74 100644 --- a/lmfdb/artin_representations/main.py +++ b/lmfdb/artin_representations/main.py @@ -45,8 +45,7 @@ def cycle_string(lis): def get_bread(breads=[]): bc = [("Artin representations", url_for(".index"))] - for b in breads: - bc.append(b) + bc.extend(b for b in breads) return bc def learnmore_list(): diff --git a/lmfdb/artin_representations/math_classes.py b/lmfdb/artin_representations/math_classes.py index 54b649d6f0..7a18277aff 100644 --- a/lmfdb/artin_representations/math_classes.py +++ b/lmfdb/artin_representations/math_classes.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from lmfdb import db -from lmfdb.utils import (url_for, pol_to_html, +from lmfdb.utils import (url_for, web_latex, coeff_to_poly, letters2num, num2letters, raw_typeset, raw_typeset_poly, pos_int_and_factor) from sage.all import PolynomialRing, QQ, ComplexField, exp, pi, Integer, valuation, CyclotomicField, RealField, log, I, factor, crt, euler_phi, primitive_root, mod, next_prime, PowerSeriesRing, ZZ @@ -572,9 +572,10 @@ def from_conjugacy_class_index_to_polynomial(self, index): field = ComplexField() root_of_unity = exp((field.gen()) * 2 * field.pi() / int(self.character_field())) local_factor_processed_pols = [0] # dummy to account for the shift in indices - for pol in local_factors: - local_factor_processed_pols.append( - process_polynomial_over_algebraic_integer(pol, field, root_of_unity)) + local_factor_processed_pols.extend( + process_polynomial_over_algebraic_integer(pol, field, + root_of_unity) + for pol in local_factors) def tmp(conjugacy_class_index_start_1): return local_factor_processed_pols[conjugacy_class_index_start_1] @@ -749,9 +750,6 @@ def polredabs(self): def polredabslatex(self): return self.polredabs()._latex_() - def polredabshtml(self): - return pol_to_html(self.polredabs()) - def label(self): if "label" in self._data: return self._data["label"] diff --git a/lmfdb/backend/base.py b/lmfdb/backend/base.py index 1e83bd4001..2aa903f087 100644 --- a/lmfdb/backend/base.py +++ b/lmfdb/backend/base.py @@ -252,7 +252,7 @@ def _execute( - ``query`` -- an SQL Composable object, the SQL command to execute. - ``values`` -- values to substitute for %s in the query. Quoting from the documentation - for psycopg2 (http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries): + for psycopg2 (https://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries): Never, never, NEVER use Python string concatenation (+) or string parameters interpolation (%) to pass variables to a SQL query string. Not even at gunpoint. @@ -784,7 +784,7 @@ def _copy_to_select(self, select, filename, header="", sep="|", silent=False): print("Created file %s" % filename) def _check_header_lines( - self, F, table_name, columns_set, sep=u"|", prohibit_missing=True + self, F, table_name, columns_set, sep="|", prohibit_missing=True ): """ Reads the header lines from a file (row of column names, row of column @@ -864,7 +864,7 @@ def _copy_from(self, filename, table, columns, header, kwds): - ``kwds`` -- passed on to psycopg2's copy_from """ kwds = dict(kwds) # to not modify the dict kwds, with the pop - sep = kwds.pop("sep", u"|") + sep = kwds.pop("sep", "|") with DelayCommit(self, silence=True): with open(filename) as F: @@ -1088,7 +1088,7 @@ def target_name(name, tablename, kind): ) done.add(i_target) # not really needed - def _read_header_lines(self, F, sep=u"|"): + def _read_header_lines(self, F, sep="|"): """ Reads the header lines from a file (row of column names, row of column types, blank line). diff --git a/lmfdb/backend/database.py b/lmfdb/backend/database.py index d3f1ff2846..38be51c1e5 100644 --- a/lmfdb/backend/database.py +++ b/lmfdb/backend/database.py @@ -1073,7 +1073,7 @@ def reload_all( """ if not os.path.isdir(data_folder): raise ValueError("The path {} is not a directory".format(data_folder)) - sep = kwds.get("sep", u"|") + sep = kwds.get("sep", "|") with DelayCommit(self, commit, silence=True): file_list = [] tablenames = [] diff --git a/lmfdb/backend/encoding.py b/lmfdb/backend/encoding.py index 7a1253decf..647f61b561 100644 --- a/lmfdb/backend/encoding.py +++ b/lmfdb/backend/encoding.py @@ -401,7 +401,7 @@ def copy_dumps(inp, typ, recursing=False): - ``typ`` -- the Postgres type of the column in which this data is being stored. """ if inp is None: - return u"\\N" + return "\\N" elif typ in ("text", "char", "varchar"): if not isinstance(inp, str): inp = str(inp) diff --git a/lmfdb/backend/searchtable.py b/lmfdb/backend/searchtable.py index a2d05f8e80..0b86c63f42 100644 --- a/lmfdb/backend/searchtable.py +++ b/lmfdb/backend/searchtable.py @@ -1363,7 +1363,7 @@ def random_sample(self, ratio, query={}, projection=1, mode=None, repeatable=Non cur = self._execute(selecter, values, buffered=True) return self._search_iterator(cur, search_cols, extra_cols, projection, query=query, silent=silent) - def copy_to_example(self, searchfile, extrafile=None, id=None, sep=u"|", commit=True): + def copy_to_example(self, searchfile, extrafile=None, id=None, sep="|", commit=True): """ This function writes files in the format used for copy_from and reload. It writes the header and a single random row. diff --git a/lmfdb/backend/table.py b/lmfdb/backend/table.py index 4615e666ac..df413e3942 100644 --- a/lmfdb/backend/table.py +++ b/lmfdb/backend/table.py @@ -991,14 +991,14 @@ def rewrite( start = time.time() count = 0 tot = self.count(query) - sep = kwds.get("sep", u"|") + sep = kwds.get("sep", "|") try: with datafile: # write headers - datafile.write(sep.join(data_cols) + u"\n") + datafile.write(sep.join(data_cols) + "\n") datafile.write( sep.join(self.col_type.get(col) for col in data_cols) - + u"\n\n" + + "\n\n" ) for rec in self.search(query, projection=projection, sort=[]): @@ -1008,7 +1008,7 @@ def rewrite( tostr_func(processed.get(col), self.col_type[col]) for col in data_cols ) - + u"\n" + + "\n" ) count += 1 if (count % progress_count) == 0: @@ -1059,7 +1059,7 @@ def update_from_file( - ``kwds`` -- passed on to psycopg2's ``copy_from``. Cannot include "columns". """ self._check_locks() - sep = kwds.get("sep", u"|") + sep = kwds.get("sep", "|") print("Updating %s from %s..." % (self.search_table, datafile)) now = time.time() if label_col is None: @@ -1541,7 +1541,7 @@ def _set_ordered(self): self._id_ordered = True self._out_of_order = False - def _write_header_lines(self, F, cols, sep=u"|", include_id=True): + def _write_header_lines(self, F, cols, sep="|", include_id=True): """ Writes the header lines to a file (row of column names, row of column types, blank line). @@ -1672,7 +1672,7 @@ def reload( If the search and extra files contain ids, they should be contiguous, starting at 1. """ - sep = kwds.get("sep", u"|") + sep = kwds.get("sep", "|") suffix = "_tmp" if restat is None: restat = countsfile is None or statsfile is None @@ -2075,7 +2075,7 @@ def copy_to( - ``kwds`` -- passed on to psycopg2's ``copy_to``. Cannot include "columns". """ self._check_file_input(searchfile, extrafile, kwds) - sep = kwds.pop("sep", u"|") + sep = kwds.pop("sep", "|") search_cols = [col for col in self.search_cols if columns is None or col in columns] extra_cols = [col for col in self.extra_cols if columns is None or col in columns] diff --git a/lmfdb/characters/main.py b/lmfdb/characters/main.py index 9161467fe8..91951d2035 100644 --- a/lmfdb/characters/main.py +++ b/lmfdb/characters/main.py @@ -734,7 +734,7 @@ class DirichStats(StatsDisplay): "is_real": yesno} def __init__(self): - self.nchars = db.char_orbits.sum_column('degree') + self.nchars = 3039650754 # db.char_orbits.sum_column('degree') self.norbits = db.char_orbits.count() self.maxmod = db.char_orbits.max("modulus") diff --git a/lmfdb/characters/test_characters.py b/lmfdb/characters/test_characters.py index 747ff5b9e9..0dd82cfc43 100644 --- a/lmfdb/characters/test_characters.py +++ b/lmfdb/characters/test_characters.py @@ -2,6 +2,7 @@ from lmfdb.tests import LmfdbTest from lmfdb.characters.web_character import WebDirichlet, parity_string, bool_string from lmfdb.lfunctions.LfunctionDatabase import get_lfunction_by_url +from lmfdb.utils import comma class WebCharacterTest(LmfdbTest): @@ -15,6 +16,12 @@ def test_Dirichletmethods(self): class DirichletSearchTest(LmfdbTest): + def test_nchars(self): + from lmfdb import db + nchars = db.char_orbits.sum_column('degree') + assert nchars == 3039650754 # if this fails, one also needs to update DirichStats.__init__ + W = self.tc.get('/Character/Dirichlet/') + assert comma(nchars) in W.get_data(as_text=True) def test_order(self): W = self.tc.get('/Character/Dirichlet/?order=19-23') diff --git a/lmfdb/classical_modular_forms/code-form.yaml b/lmfdb/classical_modular_forms/code-form.yaml index 8a3f3e8795..78e9de3c3b 100644 --- a/lmfdb/classical_modular_forms/code-form.yaml +++ b/lmfdb/classical_modular_forms/code-form.yaml @@ -9,9 +9,9 @@ prompt: magma: 'magma' logo: - sage: - pari: - magma: + sage: + pari: + magma: comment: sage: | diff --git a/lmfdb/classical_modular_forms/code-space.yaml b/lmfdb/classical_modular_forms/code-space.yaml index 9fc6959435..38b19cf2cc 100644 --- a/lmfdb/classical_modular_forms/code-space.yaml +++ b/lmfdb/classical_modular_forms/code-space.yaml @@ -4,9 +4,9 @@ prompt: magma: 'magma' logo: - sage: - pari: - magma: + sage: + pari: + magma: comment: sage: | diff --git a/lmfdb/classical_modular_forms/code.yaml b/lmfdb/classical_modular_forms/code.yaml index bf54031c9c..8e37ed12da 100644 --- a/lmfdb/classical_modular_forms/code.yaml +++ b/lmfdb/classical_modular_forms/code.yaml @@ -4,9 +4,9 @@ prompt: magma: 'magma' logo: - sage: - pari: - magma: + sage: + pari: + magma: comment: sage: | diff --git a/lmfdb/classical_modular_forms/main.py b/lmfdb/classical_modular_forms/main.py index 7d8c774748..ceeccf92bc 100644 --- a/lmfdb/classical_modular_forms/main.py +++ b/lmfdb/classical_modular_forms/main.py @@ -5,7 +5,7 @@ import yaml from flask import render_template, url_for, redirect, abort, request, make_response -from sage.all import ZZ, next_prime, cached_function, prime_range, prod, gcd, nth_prime +from sage.all import ZZ, next_prime, cached_function, prime_range, prod, gcd, nth_prime, lazy_attribute from sage.databases.cremona import class_to_int, cremona_letter_code from lmfdb import db @@ -1302,32 +1302,42 @@ class CMF_stats(StatsDisplay): Class for creating and displaying statistics for classical modular forms """ def __init__(self): - self.nforms = comma(db.mf_newforms.count()) - self.nspaces = comma(db.mf_newspaces.count({'num_forms':{'$gt':0}})) - self.ndim = comma(db.mf_hecke_cc.count()) - #self.weight_knowl = display_knowl('cmf.weight', title='weight') - #self.level_knowl = display_knowl('cmf.level', title='level') self.newform_knowl = display_knowl('cmf.newform', title='newforms') self.newspace_knowl = display_knowl('cmf.newspace', title='newspaces') #stats_url = url_for(".statistics") - @property + @lazy_attribute + def nforms(self): + return comma(db.mf_newforms.count()) + + @lazy_attribute + def nspaces(self): + return comma(db.mf_newspaces.count({'num_forms':{'$gt':0}})) + + @lazy_attribute + def ndim(self): + return comma(db.mf_hecke_cc.count()) + + @lazy_attribute def short_summary(self): return r'The database currently contains %s (Galois orbits of) %s, corresponding to %s modular forms over the complex numbers. You can browse further statistics or create your own.' % (self.nforms, self.newform_knowl, self.ndim, url_for(".statistics"), url_for(".dynamic_statistics")) - @property + @lazy_attribute def summary(self): return r"The database currently contains %s (Galois orbits of) %s and %s nonzero %s, corresponding to %s modular forms over the complex numbers. In addition to the statistics below, you can also create your own." % (self.nforms, self.newform_knowl, self.nspaces, self.newspace_knowl, self.ndim, url_for(".dynamic_statistics")) + @lazy_attribute + def buckets(self): + return {'level':['1','2-10','11-100','101-1000','1001-2000', '2001-4000','4001-6000','6001-8000','8001-%d'%level_bound()], + 'weight':['1','2','3','4','5-8','9-16','17-32','33-64','65-%d'%weight_bound()], + 'dim':['1','2','3','4','5','6-10','11-20','21-100','101-1000','1001-10000','10001-100000'], + 'relative_dim':['1','2','3','4','5','6-10','11-20','21-100','101-1000'], + 'char_order':['1','2','3','4','5','6-10','11-20','21-100','101-1000'], + 'char_degree':['1','2','3','4','5','6-10','11-20','21-100','101-1000']} + extent_knowl = 'cmf.statistics_extent' table = db.mf_newforms baseurl_func = ".index" - buckets = {'level':['1','2-10','11-100','101-1000','1001-2000', '2001-4000','4001-6000','6001-8000','8001-%d'%level_bound()], - 'weight':['1','2','3','4','5-8','9-16','17-32','33-64','65-%d'%weight_bound()], - 'dim':['1','2','3','4','5','6-10','11-20','21-100','101-1000','1001-10000','10001-100000'], - 'relative_dim':['1','2','3','4','5','6-10','11-20','21-100','101-1000'], - 'char_order':['1','2','3','4','5','6-10','11-20','21-100','101-1000'], - 'char_degree':['1','2','3','4','5','6-10','11-20','21-100','101-1000']} reverses = {'cm_discs': True} sort_keys = {'projective_image': projective_image_sort_key} knowls = {'level': 'cmf.level', diff --git a/lmfdb/classical_modular_forms/templates/cmf_newform.html b/lmfdb/classical_modular_forms/templates/cmf_newform.html index 33688a90a9..673533aa73 100644 --- a/lmfdb/classical_modular_forms/templates/cmf_newform.html +++ b/lmfdb/classical_modular_forms/templates/cmf_newform.html @@ -34,7 +34,7 @@

{{KNOWL('cmf.satake_parameters',title='Satake parameters')}}

- + {% if newform.has_exact_qexp %} {% endif %} diff --git a/lmfdb/crystals/main.py b/lmfdb/crystals/main.py index 7407686cee..23c9d1acbb 100644 --- a/lmfdb/crystals/main.py +++ b/lmfdb/crystals/main.py @@ -8,8 +8,7 @@ def get_bread(breads=[]): bc = [("Crystals", url_for(".index"))] - for b in breads: - bc.append(b) + bc.extend(b for b in breads) return bc @@ -77,7 +76,7 @@ def crystal_image(crystal): response.headers['Content-Type'] = 'image/png' return response - except IOError: + except OSError: return "internal error rendering graph", 500 finally: # Get rid of the temporary directory diff --git a/lmfdb/ecnf/WebEllipticCurve.py b/lmfdb/ecnf/WebEllipticCurve.py index 9acd13a276..1aa169250e 100644 --- a/lmfdb/ecnf/WebEllipticCurve.py +++ b/lmfdb/ecnf/WebEllipticCurve.py @@ -218,7 +218,7 @@ def EC_R_plot(ainvs, xmin, xmax, ymin, ymax, colour, legend): y = var('y') c = (xmin + xmax) / 2 d = (xmax - xmin) - return implicit_plot(y ** 2 + ainvs[0] * x * y + ainvs[2] * y - x ** 3 - ainvs[1] * x ** 2 - ainvs[3] * x - ainvs[4], (x, xmin, xmax), (y, ymin, ymax), plot_points=500, aspect_ratio="automatic", color=colour) + plot(0, xmin=c - 1e-5 * d, xmax=c + 1e-5 * d, ymin=ymin, ymax=ymax, aspect_ratio="automatic", color=colour, legend_label=legend) # Add an extra plot outside the visible frame because implicit plots are buggy: their legend does not show (http://trac.sagemath.org/ticket/15903) + return implicit_plot(y ** 2 + ainvs[0] * x * y + ainvs[2] * y - x ** 3 - ainvs[1] * x ** 2 - ainvs[3] * x - ainvs[4], (x, xmin, xmax), (y, ymin, ymax), plot_points=500, aspect_ratio="automatic", color=colour) + plot(0, xmin=c - 1e-5 * d, xmax=c + 1e-5 * d, ymin=ymin, ymax=ymax, aspect_ratio="automatic", color=colour, legend_label=legend) # Add an extra plot outside the visible frame because implicit plots are buggy: their legend does not show (https://trac.sagemath.org/ticket/15903) Rx=PolynomialRing(RDF,'x') diff --git a/lmfdb/ecnf/code.yaml b/lmfdb/ecnf/code.yaml index 24f68d7f42..faf666bd49 100644 --- a/lmfdb/ecnf/code.yaml +++ b/lmfdb/ecnf/code.yaml @@ -4,9 +4,9 @@ prompt: magma: 'magma' logo: - sage: - pari: - magma: + sage: + pari: + magma: not-implemented: sage: | diff --git a/lmfdb/elliptic_curves/code.yaml b/lmfdb/elliptic_curves/code.yaml index 77f95ee0ee..271b725ee7 100644 --- a/lmfdb/elliptic_curves/code.yaml +++ b/lmfdb/elliptic_curves/code.yaml @@ -5,9 +5,9 @@ prompt: oscar: 'oscar' logo: - sage: - pari: - magma: + sage: + pari: + magma: oscar: comment: diff --git a/lmfdb/elliptic_curves/elliptic_curve.py b/lmfdb/elliptic_curves/elliptic_curve.py index 8eb3231439..f1ade13dcf 100644 --- a/lmfdb/elliptic_curves/elliptic_curve.py +++ b/lmfdb/elliptic_curves/elliptic_curve.py @@ -404,12 +404,22 @@ class EC_download(Downloader): { "sage": 'curve = EllipticCurve(out["ainvs"])', "magma": 'curve := EllipticCurve(out`ainvs);', - "gp": 'curve = ellinit(mapget(out, "ainvs"))', + "gp": 'curve = ellinit(mapget(out, "ainvs"));', "oscar": 'curve = EllipticCurve(out["ainvs"])', } ) } +def ec_postprocess(res, info, query): + labels = [rec["lmfdb_label"] for rec in res] + mwgens = {rec["lmfdb_label"]: rec["gens"] for rec in db.ec_mwbsd.search({"lmfdb_label":{"$in":labels}}, ["lmfdb_label", "gens"])} + for rec in res: + gens = mwgens.get(rec["lmfdb_label"]) + if gens is not None: + gens = [(a/c, b/c) for (a,b,c) in gens] + rec["mwgens"] = gens + return res + def make_modcurve_link(label): from lmfdb.modular_curves.main import modcurve_link return modcurve_link(label) @@ -468,6 +478,7 @@ def make_modcurve_link(label): ProcessedCol("equation", "ec.q.minimal_weierstrass_equation", "Weierstrass equation", latex_equation, short_title="Weierstrass equation", align="left", orig="ainvs", download_col="ainvs"), ProcessedCol("modm_images", "ec.galois_rep", r"mod-$m$ images", lambda v: "" + ", ".join([make_modcurve_link(s) for s in v[:5]] + ([r"$\ldots$"] if len(v) > 5 else [])) + "", short_title="mod-m images", default=lambda info: info.get("galois_image")), + MathCol("mwgens", "ec.mordell_weil_group", "MW-generators", default=False), ]) class ECDownloader(Downloader): @@ -486,7 +497,8 @@ def modify_query(self, info, query): learnmore=learnmore_list, shortcuts={'jump':elliptic_curve_jump, 'download':ECDownloader()}, - bread=lambda:get_bread('Search results')) + bread=lambda:get_bread('Search results'), + postprocess=ec_postprocess) def elliptic_curve_search(info, query): parse_rational_to_list(info, query, 'jinv', 'j-invariant') parse_ints(info, query, 'conductor') diff --git a/lmfdb/elliptic_curves/templates/ec-curve.html b/lmfdb/elliptic_curves/templates/ec-curve.html index 9c4a220d7b..32248193cd 100644 --- a/lmfdb/elliptic_curves/templates/ec-curve.html +++ b/lmfdb/elliptic_curves/templates/ec-curve.html @@ -24,7 +24,7 @@ {% endmacro %} {# - +
{{ KNOWL('cmf.embedding_label', title='Label')}}{{ KNOWL('cmf.embedding_label', 'Label')}}  \(\iota_m(\nu)\)