Skip to content

Commit

Permalink
Merge pull request #6186 from fchapoton/varia_and_typo
Browse files Browse the repository at this point in the history
some typos and various small code details
  • Loading branch information
roed314 authored Sep 9, 2024
2 parents 83e553f + 755f0da commit d052b8b
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion lmfdb/artin_representations/math_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 4 additions & 2 deletions lmfdb/ecnf/WebEllipticCurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/elliptic_curves/code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/groups/abstract/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ def download_group(**args):
if dltype == "oscar":
# 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 + " The group will be created as a polycyclic group (not necessarily matching the presentation in the LMFDB).\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 permutation group (not necessarily using the generators used in the LMFDB).\n"
Expand Down
11 changes: 5 additions & 6 deletions lmfdb/groups/abstract/web_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ def abstract_group_display_knowl(label, name=None, pretty=True, ambient=None, au
return f'<a title = "{name} [lmfdb.object_information]" knowl="lmfdb.object_information" kwargs="args={args}&func=group_data">{name}</a>'

def primary_to_smith(invs):
if invs==[]:
return([])
if not invs:
return []
by_p = defaultdict(list)
for q in invs:
p, _ = q.is_prime_power(get_data=True)
Expand Down Expand Up @@ -1339,10 +1339,9 @@ def contains(G):
return [h for h in G.normal_contains if test(subs[h])]
nodes = [H for H in subs.values() if test(H)]
if self.outer_equivalence or not sub_aut:
edges = []
for G in nodes:
for h in contains(G):
edges.append([h, G.short_label])
edges = [[h, G.short_label]
for G in nodes
for h in contains(G)]
else:
# Subgroups are stored up to conjugacy but we want them up to automorphism.
# We pick a rep from each autjugacy class
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/higher_genus_w_automorphisms/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ def parse_range2_extend(arg, key, parse_singleton=int, parse_endpoint=None, inst
else:
ret.append({a[0]:a[1]})
else:
for i in range(0, len(a)):
ret.append({a[i][0]: a[i][1], 'genus': a[i][2]})
for ai in a:
ret.append({ai[0]: ai[1], 'genus': ai[2]})
return ['$or', ret]
elif 'g' in arg: # linear function of variable g (ax+b)
if GENUS_RE.match(arg):
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/hypergm/web_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def zigzag_plot(self):
x_labels = zz[2]
y_max = max(y_values)
y_min = min(y_values)
x_values = list(range(0,len(y_values)))
x_values = list(range(len(y_values)))
x_max = len(y_values)
pts = [(i, y_values[i]) for i in x_values]
L = Graphics()
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/local_fields/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def plot_polygon(verts, polys, inds, p):
L += line([(0,0), (xmax, 0)], color="grey")
for i in range(1, ymax + 1):
L += line([(0, i), (tick, i)], color="grey")
for i in range(0, xmax + 1):
for i in range(xmax + 1):
L += line([(i, 0), (i, tick/asp_ratio)], color="grey")
for P in verts:
L += text(
Expand Down
7 changes: 4 additions & 3 deletions lmfdb/modular_curves/web_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ def fix_exp(x):
else:
equations.append("{}({})".format(lead[j], eqs[j]))
f["equations"] = equations
return(f)
return f


def difference(Ad, Bd, Am, Bm):
# Ad and Bd are lists of dimensions, Am, Bm of multiplicities
Expand Down Expand Up @@ -671,13 +672,13 @@ def formatted_jmap(self, domain_model_type):
f["equations"] += [r"1728\,\frac{E_4^3}{E_4^3-E_6^2}"]
f["nb_coords"] = nb_coords
f["coord_names"] = ["j"] + [""]*(nb_coords-1)
return(f)
return f

def formatted_E4E6(self, domain_model_type):
E4E6 = [m for m in self.modelmaps_to_display if m["codomain_label"] == "1.1.0.a.1" and m["codomain_model_type"] == 4 and m["domain_model_type"] == domain_model_type][0]
f = formatted_map(E4E6)
f["coord_names"] = ["E_4", "E_6"]
return(f)
return f

@lazy_attribute
def formatted_modelisos(self):
Expand Down
8 changes: 3 additions & 5 deletions lmfdb/number_fields/web_number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def na_text():
## Turn a list into a string (without brackets)

def list2string(li):
li2 = [str(x) for x in li]
return ','.join(li2)
return ','.join(str(x) for x in li)


def string2list(s):
s = str(s)
Expand Down Expand Up @@ -461,9 +461,7 @@ def minimal_sibling(self):
def is_reduced(self):
if not self.haskey('reduced'):
return True
if self._data['reduced'] == 0:
return False
return True
return self._data['reduced'] != 0

# Return discriminant as a sage int
def disc(self):
Expand Down
2 changes: 1 addition & 1 deletion lmfdb/templates/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ body > .debug {
padding: 0px;
}

/* highlighting menu entries (if their respective blueprint overwirtes the body_class variable!) */
/* highlighting menu entries (if their respective blueprint overwrites the body_class variable!) */
body.mwf #sidebar a.mwf { background: {{ color.sidebar_bkg_highlight }}; }
body.cmf #sidebar a.cmf { background: {{ color.sidebar_bkg_highlight }}; }
body.knowl #sidebar a.knowl { background: {{ color.sidebar_bkg_highlight_knowl }}; }
Expand Down
8 changes: 2 additions & 6 deletions lmfdb/tensor_products/galois_reps.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,7 @@ def tensor_get_an_no_deg1(L1, L2, d1, d2, BadPrimeInfo):
S = s1
if s2 <= s1:
S = s2
BadPrimes = []
for bpi in BadPrimeInfo:
BadPrimes.append(bpi[0])
BadPrimes = [bpi[0] for bpi in BadPrimeInfo]
P = prime_range(S+1)
Z = S * [1]
S = RealField()(S)
Expand Down Expand Up @@ -704,9 +702,7 @@ def tensor_get_an_deg1(L, D, BadPrimeInfo):
S = s1
if s2 <= s1:
S = s2
BadPrimes = []
for bpi in BadPrimeInfo:
BadPrimes.append(bpi[0])
BadPrimes = [bpi[0] for bpi in BadPrimeInfo]
P = prime_range(S+1)
Z = S * [1]
S = RealField()(S) # fix bug
Expand Down
6 changes: 2 additions & 4 deletions lmfdb/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@
def is_port_open(host, port):
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
sock.settimeout(1)
if sock.connect_ex((host, port)) == 0:
return True
else:
return False
return sock.connect_ex((host, port)) == 0


def abs_path_lmfdb(filename):
return os.path.relpath(os.path.join(root_lmfdb_path, filename), os.getcwd())
Expand Down
5 changes: 1 addition & 4 deletions lmfdb/verify/modcurve/modcurve_modelmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ def apply_map_to_pt(a_map, a_pt):
P = ProjectiveSpace(QQ, how_many_vars - 1, names=my_vars)
my_pt = P(a_pt.split(':'))
Pol = PolynomialRing(QQ, how_many_vars, names=my_vars)
output = []
my_pt_tuple = tuple(my_pt)
for a_pol in a_map:
output.append(Pol(a_pol)(my_pt_tuple))
return output
return [Pol(a_pol)(my_pt_tuple) for a_pol in a_map]


class modcurve_modelmaps(TableChecker):
Expand Down

0 comments on commit d052b8b

Please sign in to comment.