Skip to content

Commit

Permalink
Merge pull request #6180 from fchapoton/fix_E111_E222
Browse files Browse the repository at this point in the history
fix pycodestyle E111 and E222
  • Loading branch information
roed314 authored Sep 2, 2024
2 parents 3aa436d + ea359b8 commit d5dd294
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 37 deletions.
23 changes: 12 additions & 11 deletions lmfdb/elliptic_curves/elliptic_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<label>")
def EC_data(label):
bread = get_bread([(label, url_for_label(label)), ("Data", " ")])
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/elliptic_curves/web_ec.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def red(p):
if adelic_data:
assert len(adelic_data) == 1
my_adelic_data = adelic_data[0]
data['adelic_data'] = my_adelic_data
data['adelic_data'] = my_adelic_data
data['adelic_gens_latex'] = ",".join([str(latex(dispZmat_from_list(z,2))) for z in my_adelic_data['adelic_gens']])
M = ZZ(self.adelic_level)
data['adelic_level_latex'] = web_latex_factored_integer(M,equals=True)
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 @@ -1492,7 +1492,7 @@ def diagram_js(gp, layers, display_opts, aut=False, normal=False):
ilayer += 2
iorder += 2
if gp.outer_equivalence and ilayer>3:
ilayer -= 2
ilayer -= 2
ll = [
[
grp.subgroup,
Expand Down Expand Up @@ -1630,7 +1630,7 @@ def render_abstract_group(label, data=None):
friends += [("As the automorphism of a curve", auto_url)]

if abstract_group_label_regex.fullmatch(label) and len(gp.transitive_friends) > 0:
gal_gp_url = "/GaloisGroup/?gal="+label
gal_gp_url = "/GaloisGroup/?gal=" + label
friends += [("As a transitive group", gal_gp_url)]

if db.gps_st.count({"component_group": label}) > 0:
Expand Down
20 changes: 10 additions & 10 deletions lmfdb/groups/abstract/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,44 @@ def test_small_gps(sample_gp):
#Confirm number of non-conjugate subgroups (if known in database)
if sample_gp['number_subgroup_classes']:
SubLat = libgap.LatticeSubgroups(G)
Cons = libgap.ConjugacyClassesSubgroups(SubLat)
Cons = libgap.ConjugacyClassesSubgroups(SubLat)
print ("Number of subgroup classes match: " + str(libgap.Size(Cons) == sample_gp['number_subgroup_classes']))
if sample_gp['number_normal_subgroups']:
NormLat = libgap.NormalSubgroups(G)
print ("Number of normal subgroups match: " + str(libgap.Size(NormLat) == sample_gp['number_normal_subgroups']))
print("Number of normal subgroups match: " + str(libgap.Size(NormLat) == sample_gp['number_normal_subgroups']))

# check if minimal permutation degrees match
if sample_gp['permutation_degree']:
minpermdeg_gap = libgap.MinimalFaithfulPermutationDegree(G)
print("Minimal permutation degrees match: " + str(minpermdeg_gap == sample_gp['permutation_degree']))

# check order stats
stupid_str = 'Set(ConjugacyClasses(SmallGroup(' + id_nums[0]+ ',' + id_nums[1] + ")), z->Order(Representative(z))) "
stupid_str = 'Set(ConjugacyClasses(SmallGroup(' + id_nums[0] + ',' + id_nums[1] + ")), z->Order(Representative(z))) "
ords = libgap.eval(stupid_str)

ordsLMFDB = []
ords_list = sample_gp['order_stats']
for i in range(len(ords_list)):
ordsLMFDB.append(ords_list[i][0])
print("Order set matches: " + str(ords == ordsLMFDB))
#print(ords,ordsLMFDB)
# print(ords,ordsLMFDB)

#check degrees
irr_stats = sample_gp['irrep_stats']
# check degrees
irr_stats = sample_gp['irrep_stats']
degLMFDB = []
for i in range(len(irr_stats)):
for j in range(irr_stats[i][1]):
degLMFDB.append(irr_stats[i][0])
stupid_str_2 = 'List(Irr(SmallGroup(' + id_nums[0] + ',' + id_nums[1]+ ')), z -> z[1])'
stupid_str_2 = 'List(Irr(SmallGroup(' + id_nums[0] + ',' + id_nums[1] + ')), z -> z[1])'
degs = libgap.eval(stupid_str_2)

print("Degrees of characters match: " + str(degs == degLMFDB))
#print(degs,degLMFDB)
# print(degs,degLMFDB)


#pick random group of order <= 2000 from DB
# pick random group of order <= 2000 from DB

for i in range(10):
x = db.gps_groups_test.random({'order': {"$lte" :2000}})
x = db.gps_groups_test.random({'order': {"$lte" :2000}})
sample_gp =db.gps_groups_test.lucky({'label': x})
test_small_gps(sample_gp)
21 changes: 10 additions & 11 deletions lmfdb/groups/abstract/web_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ def properties(self):
props.extend([(r"$\card{Z(G)}$", "not computed")])

if self.aut_order is None:
props.extend([(r"$\card{\mathrm{Aut}(G)}$", "not computed")])
props.extend([(r"$\card{\mathrm{Aut}(G)}$", "not computed")])
else:
try:
props.extend([
Expand All @@ -952,7 +952,7 @@ def properties(self):
pass

if self.outer_order is None:
props.extend([(r"$\card{\mathrm{Out}(G)}$", "not computed")])
props.extend([(r"$\card{\mathrm{Out}(G)}$", "not computed")])
else:
try:
props.extend([
Expand Down Expand Up @@ -1003,7 +1003,7 @@ def subgp_paragraph(self):
ret_str=ret_str+ ", and all normal subgroups are characteristic.<p>"+charcolor
return ret_str
elif self.number_normal_subgroups < self.number_subgroups:
ret_str = "There are " + str(self.number_subgroups) + """ subgroups in <a href=" """ + str(url_for('.index', search_type='Subgroups', ambient=self.label)) + """ "> """ + str(self.number_subgroup_classes) + """ conjugacy classes</a>, <a href=" """ + str(url_for('.index', search_type='Subgroups', ambient=self.label, normal='yes'))+ """ "> """ +str(self.number_normal_subgroups) + """ normal</a>"""
ret_str = "There are " + str(self.number_subgroups) + """ subgroups in <a href=" """ + str(url_for('.index', search_type='Subgroups', ambient=self.label)) + """ "> """ + str(self.number_subgroup_classes) + """ conjugacy classes</a>, <a href=" """ + str(url_for('.index', search_type='Subgroups', ambient=self.label, normal='yes'))+ """ "> """ +str(self.number_normal_subgroups) + """ normal</a>"""
else:
ret_str = """ There are <a href=" """ +str(url_for('.index', search_type='Subgroups', ambient=self.label)) + """ "> """ +str(self.number_subgroups) + """ subgroups</a>, all normal"""
if self.number_characteristic_subgroups < self.number_normal_subgroups:
Expand Down Expand Up @@ -1137,7 +1137,7 @@ def normal_profile(self):
by_order = defaultdict(Counter)
for s in self.subgroups.values():
if s.normal:
by_order[s.subgroup_order][s.subgroup, s.subgroup_hash, s.subgroup_tex, s.quotient, s.quotient_hash, s.quotient_tex, s.quotient_order] += s.conjugacy_class_count
by_order[s.subgroup_order][s.subgroup, s.subgroup_hash, s.subgroup_tex, s.quotient, s.quotient_hash, s.quotient_tex, s.quotient_order] += s.conjugacy_class_count
if self.normal_counts is not None:
for d, cnt in zip(self.order.divisors(), self.normal_counts):
if cnt and cnt > sum(by_order[d].values()):
Expand Down Expand Up @@ -1815,10 +1815,9 @@ def aut_stats(self):
def aut_statistics(self):
if self.aut_stats is None:
return None
else:
D = Counter()
for (o, s, k, m) in self.aut_stats:
D[o] += m
D = Counter()
for o, s, k, m in self.aut_stats:
D[o] += m
return sorted(D.items())

@lazy_attribute
Expand Down Expand Up @@ -2615,7 +2614,7 @@ def repr_strg(self, other_page=False):
d = data["d"]
return f"Elements of the group are displayed as permutations of degree {d}."
elif rep_type == "PC":
rep_str = "Elements of the group are displayed as words in the presentation"
rep_str = "Elements of the group are displayed as words in the presentation"
if other_page:
return rep_str + self.representation_line("PC", skip_head=True)
else:
Expand Down Expand Up @@ -2701,7 +2700,7 @@ def code_snippets(self):
code = yaml.load(open(os.path.join(_curdir, "code.yaml")), Loader=yaml.FullLoader)
code['show'] = { lang:'' for lang in code['prompt'] }
if "PC" in self.representations:
gens = self.presentation_raw(as_str=False)
gens = self.presentation_raw(as_str=False)
pccodelist = self.representations["PC"]["pres"]
pccode = self.representations["PC"]["code"]
ordgp = self.order
Expand Down Expand Up @@ -2765,7 +2764,7 @@ def code_snippets(self):
}
for prop in code:
for lang in code['prompt']:
code[prop][lang] = code[prop][lang].format(**data)
code[prop][lang] = code[prop][lang].format(**data)
return code

# The following attributes are used in create_boolean_string
Expand Down
5 changes: 4 additions & 1 deletion lmfdb/modl_galois_representations/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,15 @@ def __init__(self):
("image_index", "image index", ["image_index", "dimension", "base_ring_order", "conductor", "num"]),
]


def groupdata(group):
parts = group.split('.')
return [int(z) for z in parts]


def groupformatter(group):
return abstract_group_display_knowl(group)
return abstract_group_display_knowl(group)


class ModLGalRep_stats(StatsDisplay):
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/modular_curves/web_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def formatted_model_html(self, m):

def title_of_model(self, lines, nb_var, typ, smooth):
if typ == 0:
title = display_knowl('ag.canonical_model', 'Canonical model') +\
title = display_knowl('ag.canonical_model', 'Canonical model') +\
r" in $\mathbb{P}^{ %d }$ " % (nb_var-1,)
if len(lines) > eqn_threshold:
title += " defined by %d equations" % (len(lines) - 1,)
Expand Down

0 comments on commit d5dd294

Please sign in to comment.