Skip to content

Commit

Permalink
Merge pull request #6178 from fchapoton/des_typos
Browse files Browse the repository at this point in the history
a few typos and more blank lines (pep E302)
  • Loading branch information
edgarcosta authored Sep 2, 2024
2 parents 7dc2cc4 + 3c73fb4 commit 87caf5a
Show file tree
Hide file tree
Showing 23 changed files with 42 additions and 24 deletions.
1 change: 1 addition & 0 deletions lmfdb/abvar/fq/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions lmfdb/abvar/fq/search_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/ecnf/WebEllipticCurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions lmfdb/elliptic_curves/congruent_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down
2 changes: 2 additions & 0 deletions lmfdb/elliptic_curves/isog_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lmfdb/elliptic_curves/test_browse_page.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from lmfdb.tests import LmfdbTest


class HomePageTest(LmfdbTest):
# All tests should pass
#
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/galois_groups/templates/character-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%- set dummy = gp.conjclasses -%}
{%- set ccs = gp.conjugacy_classes -%}
{%- if info.char_highlight -%}
<p>The row representing the character {{info.char_highlight}} is highighted below.</p>
<p>The row representing the character {{info.char_highlight}} is highlighted below.</p>
{%- endif -%}
<table class="nowrap">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/galois_groups/transitive_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/groups/abstract/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("."))
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/groups/abstract/web_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<", "&lt;").replace(">", "&gt;") 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'])
Expand Down
2 changes: 2 additions & 0 deletions lmfdb/hecke_algebras/hecke_algebras_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

logger = make_logger("hecke_algebras")


def hecke_algebras_summary():
hecke_knowl = '<a knowl="hecke_algebra.definition">Hecke algebras</a>'
level_knowl = '<a knowl="cmf.level">level</a>'
Expand All @@ -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}
1 change: 1 addition & 0 deletions lmfdb/hecke_algebras/test_hecke_algebras.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

from lmfdb.tests import LmfdbTest


class HomePageTest(LmfdbTest):
# Hecke algebra browse page
def test_hecke_algebra(self):
Expand Down
2 changes: 2 additions & 0 deletions lmfdb/lfunctions/Lfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1325,6 +1326,7 @@ def __init__(self, **args):
def original_object(self):
return self.artin


#############################################################################

class HypergeometricMotiveLfunction(Lfunction):
Expand Down
1 change: 1 addition & 0 deletions lmfdb/lfunctions/test_lfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .LfunctionPlot import paintSvgFileAll
from lmfdb.tests import LmfdbTest


class LfunctionTest(LmfdbTest):

# All tests should pass
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/maass_forms/templates/maass_browse_graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<h1>Maass forms of levels {{min_level}} to {{max_level}} with ${{min_R}} \leq R\leq {{max_R}}$</h1>
<p>
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 <b><font color="{{coloreven}}">even</font></b> or <b><font color="{{colorodd}}">odd</font></b>.
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 <b><font color="{{coloreven}}">even</font></b> or <b><font color="{{colorodd}}">odd</font></b>.
</p>

<p>In the plot below each dot is linked to the homepage of the corresponding {{KNOWL('mf.maass.mwf',title='Maass forms')}}.</p>
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/maass_forms/web_maassform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions lmfdb/modular_curves/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions lmfdb/modular_curves/web_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ def formatted_newforms(newforms, mults):
return ", ".join(f'<a href="{url_for_mf_label(label)}">{label}</a>{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):
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/uploads/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/utils/display_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/utils/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/utils/search_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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``.
Expand Down
5 changes: 3 additions & 2 deletions lmfdb/utils/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down Expand Up @@ -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)
Expand All @@ -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])
Expand Down

0 comments on commit 87caf5a

Please sign in to comment.