Skip to content

Commit

Permalink
Merge pull request #5896 from fchapoton/remove_whitespaces
Browse files Browse the repository at this point in the history
remove trailing whitespaces (scripted using ruff)
  • Loading branch information
edgarcosta authored Mar 7, 2024
2 parents 53f364d + ef243f2 commit 53d6784
Show file tree
Hide file tree
Showing 29 changed files with 108 additions and 108 deletions.
4 changes: 2 additions & 2 deletions scripts/artin_representations/extract_art.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is for generating information for computing Artin L-functions
# Run it with
# Run it with
# sage -python extract_art.py artinlabel count
#
# where artinlabel is the label for a specific artin representation
Expand Down Expand Up @@ -132,7 +132,7 @@ def myroots(pol, n, zeta):
p = next_prime(p)
outfile.write(str(ar.any_prime_to_cc_index(p))+"\n")
j+=1

#plist = [ar.any_prime_to_cc_index(p) for p in primes_first_n(bound)]
#for j in plist:
# outfile.write(str(j)+"\n")
Expand Down
2 changes: 1 addition & 1 deletion scripts/artin_representations/import_art_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def fix_local_factors(gconj):

# There are two parts since we need to deal with two files/databases
# The two functions below take our for one entry as a dictionary, and reformats
# the dictionary
# the dictionary

outrecs = []

Expand Down
4 changes: 2 additions & 2 deletions scripts/artin_representations/old-import_art_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def artrepload(l):
old += 1
if (count+old) % 100==0:
print("%s new, %s old" %(str(count),str(old)))
return
return
l['Conductor'] = ZZ(l['Conductor'])
l['GaloisConjugates'] = [fix_local_factors(z) for z in l['GaloisConjugates']]
# Extract containing representation from the label
Expand Down Expand Up @@ -85,7 +85,7 @@ def nfgalload(l):
old += 1
if (count+old) % 100==0:
print("%s new, %s old" %(str(count),str(old)))
return
return

artreps=l['ArtinReps']
artreps=[{'Baselabel': z[0][0], 'GalConj': z[0][1], 'CharacterField': z[1],
Expand Down
6 changes: 3 additions & 3 deletions scripts/belyi/format_plane_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import re
RE_EXP = r"\^(\d+)"

def bracket_me(m):
return "^{%s}" % (m.group(0)).split("^")[1]
def bracket_me(m):
return "^{%s}" % (m.group(0)).split("^")[1]

def fix_brackets(rec):
if rec.get('plane_model_latex'):
latex = rec['plane_model_latex']
latex = re.sub(RE_EXP, bracket_me,latex)
latex = re.sub(RE_EXP, bracket_me,latex)
rec['plane_model_latex'] = latex
return rec

Expand Down
2 changes: 1 addition & 1 deletion scripts/belyi/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def primitive(rec):
if rec['primitivization'] == rec['label']:
rec['is_primitive'] = True
else:
rec['is_primitive'] = False
rec['is_primitive'] = False
return rec

# get primitivization for passports by pulling from galmaps
Expand Down
8 changes: 4 additions & 4 deletions scripts/ecnf/bmf_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def gen_name(d):
gen_names = dict([(field,gen_name(d)) for field,d in zip(fields, abs_discs)])

false_curves = {'2.0.4.1': ['34225.7-a', '34225.7-b', '34225.3-a', '34225.3-b'],

'2.0.8.1': ['5625.1-b', '5625.3-b', '6561.5-a', '6561.5-d',
'21609.1-b', '21609.1-c', '21609.3-b', '21609.3-c'],

Expand Down Expand Up @@ -72,7 +72,7 @@ def field_from_label(lab):
# database. Here 'matching' means same label, conductor=label and ap
# agree. This must allow for the valid non-existence of curves for
# some newforms.

def check_curves(field_label='2.0.4.1', min_norm=0, max_norm=None, label=None, check_ap = False, verbose=False):
r"""Go through all Bianchi Modular Forms with the given field label,
assumed imaginary quadratic (i.e. '2.0.d.1' with d in
Expand Down Expand Up @@ -108,7 +108,7 @@ def check_curves(field_label='2.0.4.1', min_norm=0, max_norm=None, label=None, c
nok = 0
missing_curves = []
mismatches = []

primes = list(primes_iter(K,maxnorm=1000)) if check_ap else []
curve_ap = {} # curve_ap[conductor_label] will be a dict iso -> ap
form_ap = {} # form_ap[conductor_label] will be a dict iso -> ap
Expand Down Expand Up @@ -205,4 +205,4 @@ def check_curves(field_label='2.0.4.1', min_norm=0, max_norm=None, label=None, c
print("{} form-curve pairs had inconsistent ap:".format(len(mismatches)))
print(mismatches)


16 changes: 8 additions & 8 deletions scripts/ecnf/elliptic_curve_to_ecnf_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@


def EllipticCurve_from_hoeij_data(line):
"""Given a line of the file "http://www.math.fsu.edu/~hoeij/files/X1N/LowDegreePlaces"
"""Given a line of the file "http://www.math.fsu.edu/~hoeij/files/X1N/LowDegreePlaces"
that is actually corresponding to an elliptic curve, this function returns the elliptic
curve corresponding to this
"""
Rx=PolynomialRing(QQ,'x')
x = Rx.gen(0)
Rxy = PolynomialRing(Rx,'y')
y = Rxy.gen(0)

N=ZZ(line.split(",")[0].split()[-1])
x_rel=Rx(line.split(',')[-2][2:-4])
assert x_rel.leading_coefficient()==1
Expand Down Expand Up @@ -48,10 +48,10 @@ def EllipticCurve_from_hoeij_data(line):
def to_polredabs(K):
"""
INPUT:
INPUT:
* "K" - a number field
OUTPUT:
* "phi" - an isomorphism K -> L, where L = QQ['x']/f and f a polynomial such that f = polredabs(f)
Expand Down Expand Up @@ -94,7 +94,7 @@ def EllipticCurve_polredabs_a_invariants(E,morphism=True):
Input:
- E - an elliptic curve over a number field K
Output:
- [a1,a2,a3,a4,a6] - the a_invariants of E base changed along phi: K -> L
- [a1,a2,a3,a4,a6] - the a_invariants of E base changed along phi: K -> L
where phi is the morphism from K to its polredabs field
"""
K = E.base_field()
Expand All @@ -106,17 +106,17 @@ def EllipticCurve_polredabs_a_invariants(E,morphism=True):
#E_polred = base_change(E,phi)
#assert E.conductor().norm() == E_polred.conductor().norm()
#return E_polred

def EllipticCurve_polredabs(E):
"""
Input:
- E - an elliptic curve over a number field K
Output:
- E1 - the elliptic curve that is the base change of E along phi: K -> L
- E1 - the elliptic curve that is the base change of E along phi: K -> L
where phi is the morphism from K to its polredabs field
"""
return EllipticCurve(EllipticCurve_polredabs_a_invariants(E,False))

def EllipticCurve_to_ecnf_dict(E):
"""
Make the dict that should be fed to `make_curves_line` in `lmfdb/scripts/ecnf/import_utils.py`.
Expand Down
2 changes: 1 addition & 1 deletion scripts/ecnf/hmf_check_find.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def find_curve_labels(field_label='2.2.5.1', min_norm=0, max_norm=None, outfilen
# 1) for the given field are processed; one can also specify a range
# of level norms, or an individual newform label (without the field
# prefix).

def find_curves(field_label='2.2.5.1', min_norm=0, max_norm=None, label=None, outfilename=None, verbose=False, effort=500):
r""" Go through all Hilbert Modular Forms with the given field label,
assumed totally real, for level norms in the given range, test
Expand Down
2 changes: 1 addition & 1 deletion scripts/genus2_curves/g2LocSolv.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def IsSquareInQp(x, p):


def HasFinitePointAt(F, p, c):
"""
"""
Tests whether y²=c*F(x) has a finite Qp-point with x and y both in Zp,
assuming that deg F = 6 and F integral
"""
Expand Down
14 changes: 7 additions & 7 deletions scripts/half_integral_weight_modular_forms/half_int_weight_mf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
r""" Import half-integral weight modular form data.
r""" Import half-integral weight modular form data.
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
and returns that.
The rest of this should be updated for modular forms:
Expand Down Expand Up @@ -42,7 +42,7 @@
forms = C.forms


saving = True
saving = True

def sd(f):
for k in f.keys():
Expand Down Expand Up @@ -73,7 +73,7 @@ def do_import(ll):
entry = {'mf_label' : mf_label, 'nf_label' : nf_label, 'dim_image' : dim_image, 'half_forms' : half_forms}
newpart.append(entry)
data['newpart'] = newpart

label = base_label(data['level'],data['weight'],data['character'])
data['label'] = label
form = forms.find_one({'label': label})
Expand Down
14 changes: 7 additions & 7 deletions scripts/hecke_algebras/hecke_algebras.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
r""" Import Hecke algebras.
r""" Import Hecke algebras.
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
and returns that.
"""
Expand All @@ -25,7 +25,7 @@
C['hecke_algebras'].authenticate('editor', password)
hecke_algebras = C['hecke_algebras'].hecke_algebras

saving = True
saving = True

def sd(f):
for k in f.keys():
Expand All @@ -43,7 +43,7 @@ def string2list(s):


# The following create_index command checks if there is an index on
# label, dimension, determinant and level.
# label, dimension, determinant and level.


hecke_algebras.create_index('level')
Expand Down
4 changes: 2 additions & 2 deletions scripts/hecke_algebras/hecke_algebras_db_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from lmfdb.base import getDBConnection
from data_mgt.utilities.rewrite import update_attribute_stats


def update_stats(verbose=True):
h = getDBConnection().hecke_algebras
update_attribute_stats(h,'hecke_algebras','level', nocounts=True)
Expand Down
14 changes: 7 additions & 7 deletions scripts/hecke_algebras/hecke_algebras_l_adic.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
r""" Import Hecke algebras.
r""" Import Hecke algebras.
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
and returns that.
"""
Expand All @@ -25,7 +25,7 @@
C['hecke_algebras'].authenticate('editor', password)
hecke_orb_l = C['hecke_algebras'].hecke_algebras_l_adic

saving = True
saving = True

def sd(f):
for k in f.keys():
Expand All @@ -43,7 +43,7 @@ def string2list(s):


# The following create_index command checks if there is an index on
# label, dimension, determinant and level.
# label, dimension, determinant and level.

hecke_orb_l.create_index('level')
hecke_orb_l.create_index('weight')
Expand Down
14 changes: 7 additions & 7 deletions scripts/hecke_algebras/hecke_algebras_orbits.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
r""" Import Hecke algebras.
r""" Import Hecke algebras.
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
Note: This code can be run on all files in any order. Even if you
rerun this code on previously entered files, it should have no affect.
This code checks if the entry exists, if so returns that and updates
with new information. If the entry does not exist then it creates it
and returns that.
"""
Expand All @@ -25,7 +25,7 @@
C['hecke_algebras'].authenticate('editor', password)
hecke_orb = C['hecke_algebras'].hecke_algebras_orbits

saving = True
saving = True

def sd(f):
for k in f.keys():
Expand All @@ -43,7 +43,7 @@ def string2list(s):


# The following create_index command checks if there is an index on
# label, dimension, determinant and level.
# label, dimension, determinant and level.

hecke_orb.create_index('level')
hecke_orb.create_index('weight')
Expand Down
6 changes: 3 additions & 3 deletions scripts/higher_genus_w_automorphisms/hgcwa_complete_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def compute_values():

data = []
hgcwa = db.hgcwa_passports

for genus in range(2, hgcwa.max('genus')+1):

# hgcwa_complete has exactly one row for each genus
table_entry = db.hgcwa_complete.lookup(genus)

row = [genus]

if table_entry is not None:
if table_entry is not None:
# retrieve some of the previous values
row.extend([table_entry['g0_gt0_compute'], table_entry['top_braid_compute'], table_entry['top_braid_g0_gt0']])
else: # a new genus is being added
Expand Down Expand Up @@ -61,5 +61,5 @@ def compute_values():

row.extend([num_families, num_refined_pp, num_gen_vectors, num_unique_groups])
data.append(row)

return data
6 changes: 3 additions & 3 deletions scripts/higher_genus_w_automorphisms/unique_groups_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def compute_ug_data():
# rows for g0 = 0 table on unique groups page
comp_info = compdb.lucky({'genus': genus},sort=[])
group_stats_0 = hgcwa.count({'genus':genus, 'g0': 0}, ['group'])
for group, gen_vectors in group_stats_0.items():
for group, gen_vectors in group_stats_0.items():
grp = group[0]
grp_print = grp.replace('[','{').replace(']','}')
labels = hgcwa.distinct('label', {'genus':genus, 'g0': 0, 'group': grp})
Expand All @@ -46,9 +46,9 @@ def compute_ug_data():
topological += len(hgcwa.distinct('topological', {'label': label}))
braid += len(hgcwa.distinct('braid', {'label': label}))
data.append([grp_print, genus, "f", "\\N", gen_vectors, topological, braid])
else:
else:
data.append([grp_print, genus, "f", "\\N", gen_vectors, "\\N", "\\N"])

# rows for g0 > 0 table on unique groups page
if comp_info['g0_gt0_compute']:
group_stats_gt0 = hgcwa.count({'genus':genus, 'g0':{'$gt':0}}, ['group'])
Expand Down
Loading

0 comments on commit 53d6784

Please sign in to comment.