Skip to content

Commit 34884c7

Browse files
authored
Merge pull request #17 from edgarcosta/autopep8-patches
Fixes by autopep8 action
2 parents 879ebbc + 5d5970f commit 34884c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+404
-413
lines changed

lmfdb/api/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def apierror(msg, flash_extras=[], code=404, table=True):
289289
if 'bytea' in coll.col_type.values():
290290
for row in data:
291291
for key, val in row.items():
292-
if type(val) == buffer:
292+
if isinstance(val, buffer):
293293
row[key] = "[binary data]"
294294
#data = [ dict([ (key, val if coll.col_type[key] != 'bytea' else "binary data") for key, val in row.items() ]) for row in data]
295295
data = Json.prep(data)

lmfdb/app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ def netloc_redirect():
275275
return redirect(url, code=301)
276276
elif (
277277
urlparts.netloc == "www.lmfdb.org"
278-
and
279-
not white_listed(urlparts.path)
278+
279+
and not white_listed(urlparts.path)
280280
and valid_bread(urlparts.path)
281281
):
282282
replaced = urlparts._replace(netloc="beta.lmfdb.org", scheme="https")

lmfdb/backend/statstable.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def column_counts(self, cols, constraint=None, threshold=1, split_list=False):
564564
).format(Identifier(self.counts), thresh)
565565
cur = self._execute(selecter, [jallcols, split_list])
566566
if one_col:
567-
_make_tuple = lambda x: make_tuple(x)[0]
567+
def _make_tuple(x): return make_tuple(x)[0]
568568
else:
569569
_make_tuple = make_tuple
570570
if constraint is None:
@@ -1096,7 +1096,7 @@ def numstats(self, col, grouping, constraint=None, threshold=None):
10961096
selecter = selecter.format(Identifier(self.stats), threshold)
10971097
nstats = defaultdict(dict)
10981098
if onegroup:
1099-
_make_tuple = lambda x: make_tuple(x)[0]
1099+
def _make_tuple(x): return make_tuple(x)[0]
11001100
else:
11011101
_make_tuple = make_tuple
11021102
for rec in self._execute(selecter, values):

lmfdb/bianchi_modular_forms/bianchi_modular_form.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ def bmf_field_dim_table(**args):
283283
weights = set()
284284
for dat in data:
285285
weights = weights.union(set(dat[gl_or_sl].keys()))
286-
weights = [int(w) for w in weights]
287-
weights.sort()
286+
weights = sorted([int(w) for w in weights])
288287
info['weights'] = weights
289288
info['nweights'] = len(weights)
290289

lmfdb/characters/ListCharacters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_character_modulus(a, b, limit=7):
7272
entry.append(el)
7373
entries[(row, col)] = entry
7474
entries2 = {}
75-
out = lambda chi: (chi.number, chi.is_primitive(),
75+
def out(chi): return (chi.number, chi.is_primitive(),
7676
chi.multiplicative_order(), chi.is_even())
7777
for k, v in entries.items():
7878
l = []

lmfdb/characters/web_character.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def prevprimchar(m, n):
265265
def nextprimchar(m, n):
266266
if m < 3:
267267
return 3, 2
268-
while 1:
268+
while True:
269269
n += 1
270270
if n >= m:
271271
m, n = m + 1, 2
@@ -721,8 +721,7 @@ def __init__(self, **args):
721721
def structure(self):
722722
inv = self.H.invariants()
723723
if inv:
724-
inv_list = list(inv)
725-
inv_list.sort()
724+
inv_list = sorted(inv)
726725
return r"\(%s\)" % ("\\times ".join("C_{%s}" % d for d in inv_list))
727726
else:
728727
return r"\(C_1\)"

lmfdb/classical_modular_forms/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ def delete_false(D):
10231023

10241024
def dimension_space_postprocess(res, info, query):
10251025
if ((query.get('weight_parity') == -1 and query.get('char_parity') == 1)
1026-
or
1027-
(query.get('weight_parity') == 1 and query.get('char_parity') == -1)):
1026+
1027+
or (query.get('weight_parity') == 1 and query.get('char_parity') == -1)):
10281028
raise ValueError("Inconsistent parity for character and weight")
10291029
urlgen_info = dict(info)
10301030
urlgen_info['count'] = 50

lmfdb/classical_modular_forms/test_cmf.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -550,30 +550,30 @@ def test_satake(self):
550550

551551
def test_underlying_data(self):
552552
data = self.tc.get('/ModularForm/GL2/Q/holomorphic/data/13.2').get_data(as_text=True)
553-
assert ('mf_gamma1' in data and 'newspace_dims' in data and
554-
'mf_gamma1_subspaces' in data and 'sub_mult' in data and
555-
'mf_gamma1_portraits' in data and "data:image/png;base64" in data)
553+
assert ('mf_gamma1' in data and 'newspace_dims' in data
554+
and 'mf_gamma1_subspaces' in data and 'sub_mult' in data
555+
and 'mf_gamma1_portraits' in data and "data:image/png;base64" in data)
556556

557557
data = self.tc.get('/ModularForm/GL2/Q/holomorphic/data/13.2.e').get_data(as_text=True)
558-
assert ('mf_newspaces' in data and 'num_forms' in data and
559-
'mf_subspaces' in data and 'sub_mult' in data and
560-
'mf_newspace_portraits' in data and "data:image/png;base64" in data and
561-
'mf_hecke_newspace_traces' in data and 'trace_an' in data)
558+
assert ('mf_newspaces' in data and 'num_forms' in data
559+
and 'mf_subspaces' in data and 'sub_mult' in data
560+
and 'mf_newspace_portraits' in data and "data:image/png;base64" in data
561+
and 'mf_hecke_newspace_traces' in data and 'trace_an' in data)
562562

563563
data = self.tc.get('/ModularForm/GL2/Q/holomorphic/data/13.2.e.a').get_data(as_text=True)
564564
assert ('mf_newforms' in data and 'field_disc_factorization' in data and
565-
'mf_hecke_nf' in data and 'hecke_ring_character_values' in data and
566-
'mf_newspaces' in data and 'num_forms' in data and
567-
'mf_twists_nf' in data and 'twisting_char_label' in data and
568-
'mf_hecke_charpolys' in data and 'charpoly_factorization' in data and
569-
'mf_newform_portraits' in data and "data:image/png;base64" in data and
570-
'mf_hecke_traces' in data and 'trace_an' in data)
565+
'mf_hecke_nf' in data and 'hecke_ring_character_values' in data
566+
and 'mf_newspaces' in data and 'num_forms' in data
567+
and 'mf_twists_nf' in data and 'twisting_char_label' in data
568+
and 'mf_hecke_charpolys' in data and 'charpoly_factorization' in data
569+
and 'mf_newform_portraits' in data and "data:image/png;base64" in data
570+
and 'mf_hecke_traces' in data and 'trace_an' in data)
571571

572572
data = self.tc.get('/ModularForm/GL2/Q/holomorphic/data/13.2.e.a.4.1').get_data(as_text=True)
573573
assert ('mf_newforms' in data and 'field_disc_factorization' in data and
574-
'mf_hecke_cc' in data and 'an_normalized' in data and
575-
'mf_newspaces' in data and 'num_forms' in data and
576-
'mf_twists_cc' in data and 'twisting_conrey_index' in data and
577-
'mf_hecke_charpolys' in data and 'charpoly_factorization' in data and
578-
'mf_newform_portraits' in data and "data:image/png;base64" in data and
579-
'mf_hecke_traces' in data and 'trace_an' in data)
574+
'mf_hecke_cc' in data and 'an_normalized' in data
575+
and 'mf_newspaces' in data and 'num_forms' in data
576+
and 'mf_twists_cc' in data and 'twisting_conrey_index' in data
577+
and 'mf_hecke_charpolys' in data and 'charpoly_factorization' in data
578+
and 'mf_newform_portraits' in data and "data:image/png;base64" in data
579+
and 'mf_hecke_traces' in data and 'trace_an' in data)

lmfdb/classical_modular_forms/web_newform.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ def convert_qexp_to_cyclotomic(self, m):
297297
zeta = F.gens()[0]
298298
ret = []
299299
l = len(self.hecke_ring_numerators)
300-
betas = [F(self.hecke_ring_numerators[i]) /
301-
self.hecke_ring_denominators[i] for i in range(l)]
300+
betas = [F(self.hecke_ring_numerators[i])
301+
/ self.hecke_ring_denominators[i] for i in range(l)]
302302
write_in_powers = zeta.coordinates_in_terms_of_powers()
303303
for coeffs in self.qexp:
304304
elt = sum([coeffs[i] * betas[i] for i in range(l)])
@@ -339,8 +339,8 @@ def friends(self):
339339
nf_url = ns_url + '/' + self.hecke_orbit_label
340340
if self.embedding_label is not None:
341341
res.append(('Newform orbit ' + self.label, nf_url))
342-
if (self.dual_label is not None and
343-
self.dual_label != self.embedding_label):
342+
if (self.dual_label is not None
343+
and self.dual_label != self.embedding_label):
344344
dlabel = self.label + '.' + self.dual_label
345345
d_url = nf_url + '/' + self.dual_label.replace('.', '/') + '/'
346346
res.append(('Dual form ' + dlabel, d_url))

lmfdb/ecnf/WebEllipticCurve.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ def make_E(self):
457457
self.ar = "not available"
458458

459459
# for debugging:
460-
assert self.rk == "not available" or (self.rk_lb == self.rank and
461-
self.rank == self.rk_ub)
460+
assert self.rk == "not available" or (self.rk_lb == self.rank
461+
and self.rank == self.rk_ub)
462462
assert self.ar=="not available" or (self.rk_lb<=self.analytic_rank and self.analytic_rank<=self.rk_ub)
463463

464464
self.bsd_status = "incomplete"

lmfdb/elliptic_curves/elliptic_curve.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1009,10 +1009,10 @@ def __init__(self):
10091009
example="1728",
10101010
example_span="1728 or -4096/11")
10111011
# ℤ is &#8484; in html
1012-
torsion_opts = ([("", ""), ("[]", "trivial")] +
1013-
[("%s" % n, "order %s" % n) for n in range(4, 16, 4)] +
1014-
[("[%s]" % n, "ℤ/%sℤ" % n) for n in range(2, 13) if n != 11] +
1015-
[("[2,%s]" % n, "ℤ/2ℤ&oplus;ℤ/%sℤ" % n) for n in range(2, 10, 2)])
1012+
torsion_opts = ([("", ""), ("[]", "trivial")]
1013+
+ [("%s" % n, "order %s" % n) for n in range(4, 16, 4)]
1014+
+ [("[%s]" % n, "ℤ/%sℤ" % n) for n in range(2, 13) if n != 11]
1015+
+ [("[2,%s]" % n, "ℤ/2ℤ&oplus;ℤ/%sℤ" % n) for n in range(2, 10, 2)])
10161016
torsion = SelectBox(
10171017
name="torsion",
10181018
label="Torsion",
@@ -1080,9 +1080,9 @@ def __init__(self):
10801080
knowl="ec.maximal_elladic_galois_rep",
10811081
example="2,3",
10821082
select_box=nonmax_quant)
1083-
cm_opts = ([('', ''), ('noCM', 'no potential CM'), ('CM', 'potential CM')] +
1084-
[('-4,-16', 'CM field Q(sqrt(-1))'), ('-3,-12,-27', 'CM field Q(sqrt(-3))'), ('-7,-28', 'CM field Q(sqrt(-7))')] +
1085-
[('-%d'%d, 'CM discriminant -%d'%d) for d in [3,4,7,8,11,12,16,19,27,28,43,67,163]])
1083+
cm_opts = ([('', ''), ('noCM', 'no potential CM'), ('CM', 'potential CM')]
1084+
+ [('-4,-16', 'CM field Q(sqrt(-1))'), ('-3,-12,-27', 'CM field Q(sqrt(-3))'), ('-7,-28', 'CM field Q(sqrt(-7))')]
1085+
+ [('-%d'%d, 'CM discriminant -%d'%d) for d in [3,4,7,8,11,12,16,19,27,28,43,67,163]])
10861086
cm = SelectBox(
10871087
name="cm",
10881088
label="Complex multiplication",

lmfdb/elliptic_curves/isog_class.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def make_class(self):
115115
# permute rows/cols to match labelling: the rows/cols in the
116116
# ec_classdata table are with respect to LMFDB ordering.
117117
if self.label_type == 'Cremona':
118-
perm = lambda i: next(c for c in self.curves if c['Cnumber']==i+1)['lmfdb_number']-1
118+
def perm(i): return next(c for c in self.curves if c['Cnumber']==i+1)['lmfdb_number']-1
119119
M = [[M[perm(i)][perm(j)] for i in range(ncurves)] for j in range(ncurves)]
120120

121121
M = Matrix(M)

lmfdb/elliptic_curves/web_ec.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def gl2_subgroup_data(label):
7171
except ValueError:
7272
return "Unable to locate data for GL(2,Zhat) subgroup with label: %s" % label
7373

74-
row_wrap = lambda cap, val: "<tr><td>%s: </td><td>%s</td></tr>\n" % (cap, val)
75-
matrix = lambda m: r'$\begin{bmatrix}%s&%s\\%s&%s\end{bmatrix}$' % (m[0],m[1],m[2],m[3])
74+
def row_wrap(cap, val): return "<tr><td>%s: </td><td>%s</td></tr>\n" % (cap, val)
75+
def matrix(m): return r'$\begin{bmatrix}%s&%s\\%s&%s\end{bmatrix}$' % (m[0],m[1],m[2],m[3])
7676
info = '<table>\n'
7777
info += row_wrap('Subgroup <b>%s</b>' % (label), "<small>" + ', '.join(matrix(m) for m in data['generators']) + "</small>")
7878
info += "<tr><td></td><td></td></tr>\n"

lmfdb/galois_groups/transitive_group.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ def subfield_display(n, subs):
477477
def otherrep_display(n, t, reps):
478478
reps = [(j[0], j[1]) for j in reps]
479479
me = (n, t)
480-
difreps = list(set(reps))
481-
difreps.sort()
480+
difreps = sorted(set(reps))
482481
ans = ''
483482
for k in difreps:
484483
if ans != '':

lmfdb/genus2_curves/test_genus2_curves.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,11 @@ def test_related_objects(self):
349349
def test_underlying_data(self):
350350
data = self.tc.get("/Genus2Curve/Q/data/576.a.576.1").get_data(as_text=True)
351351
assert ('g2c_curves' in data and 'bad_lfactors' in data and
352-
'g2c_endomorphisms' in data and 'factorsQQ_base' in data and
353-
'g2c_ratpts' in data and 'mw_gens_v' in data and
354-
'g2c_galrep' in data and 'modell_image' in data and
355-
'g2c_tamagawa' in data and 'tamagawa_number' in data and
356-
'g2c_plots' in data and "data:image/png;base64" in data)
352+
'g2c_endomorphisms' in data and 'factorsQQ_base' in data
353+
and 'g2c_ratpts' in data and 'mw_gens_v' in data
354+
and 'g2c_galrep' in data and 'modell_image' in data
355+
and 'g2c_tamagawa' in data and 'tamagawa_number' in data
356+
and 'g2c_plots' in data and "data:image/png;base64" in data)
357357

358358
def test_jump(self):
359359
from sage.all import magma

lmfdb/genus2_curves/web_g2c.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,9 @@ def gsp4_subgroup_data(label):
519519
data = db.gps_gsp4zhat.lookup(label)
520520
except ValueError:
521521
return "Invalid label for subgroup of GSp(4,Zhat): %s" % label
522-
row_wrap = lambda cap, val: "<tr><td>%s: </td><td>%s</td></tr>\n" % (cap, val)
523-
matrix = lambda m: r'$\begin{bmatrix}%s&%s&%s&%s\\%s&%s&%s&%s\\%s&%s&%s&%s\\%s&%s&%s&%s\end{bmatrix}$' % (m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15])
522+
523+
def row_wrap(cap, val): return "<tr><td>%s: </td><td>%s</td></tr>\n" % (cap, val)
524+
def matrix(m): return r'$\begin{bmatrix}%s&%s&%s&%s\\%s&%s&%s&%s\\%s&%s&%s&%s\\%s&%s&%s&%s\end{bmatrix}$' % (m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15])
524525
info = '<table>\n'
525526
info += row_wrap('Subgroup <b>%s</b>' % (label), "<small>" + ', '.join(matrix(m) for m in data['generators']) + "</small>")
526527
info += "<tr><td></td><td></td></tr>\n"
@@ -920,8 +921,8 @@ def make_object(self, curve, endo, tama, ratpts, clus, galrep, is_curve):
920921
data['gl2_statement_base'] = gl2_statement_base(endo['factorsRR_base'], r'\(\Q\)')
921922
data['factorsQQ_base'] = endo['factorsQQ_base']
922923
data['factorsRR_base'] = endo['factorsRR_base']
923-
data['end_statement_base'] = (r"Endomorphism %s over \(\Q\):<br>" % ("ring" if is_curve else "algebra") +
924-
end_statement(data['factorsQQ_base'], endo['factorsRR_base'], ring=data['end_ring_base'] if is_curve else None))
924+
data['end_statement_base'] = (r"Endomorphism %s over \(\Q\):<br>" % ("ring" if is_curve else "algebra")
925+
+ end_statement(data['factorsQQ_base'], endo['factorsRR_base'], ring=data['end_ring_base'] if is_curve else None))
925926

926927
# Field over which all endomorphisms are defined
927928
data['end_field_label'] = endo['fod_label']
@@ -933,8 +934,8 @@ def make_object(self, curve, endo, tama, ratpts, clus, galrep, is_curve):
933934
data['factorsRR_geom'] = endo['factorsRR_geom']
934935
if data['end_field_label'] != '1.1.1.1':
935936
data['gl2_statement_geom'] = gl2_statement_base(data['factorsRR_geom'], r'\(\overline{\Q}\)')
936-
data['end_statement_geom'] = (r"Endomorphism %s over \(\overline{\Q}\):" % ("ring" if is_curve else "algebra") +
937-
end_statement(data['factorsQQ_geom'], data['factorsRR_geom'], field=r'\overline{\Q}', ring=data['end_ring_geom'] if is_curve else None))
937+
data['end_statement_geom'] = (r"Endomorphism %s over \(\overline{\Q}\):" % ("ring" if is_curve else "algebra")
938+
+ end_statement(data['factorsQQ_geom'], data['factorsRR_geom'], field=r'\overline{\Q}', ring=data['end_ring_geom'] if is_curve else None))
938939
data['real_geom_end_alg_name'] = real_geom_end_alg_name(curve['real_geom_end_alg'])
939940
data['geom_end_alg_name'] = geom_end_alg_name(curve['geom_end_alg'])
940941
data['end_alg_name'] = end_alg_name(curve['end_alg'])

lmfdb/groups/abstract/groups_test_pages.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ def all_abstract_groups(self, maxord=None, chunksize=1000):
7474
res = sum((outp for (inp, outp) in self.abstract_groups_of_order(inputs)), [])
7575
errors = [url for (t, url) in res if t is None]
7676
errors
77-
working_urls = [(t, url) for (t, url) in res if t is not None]
78-
working_urls.sort()
77+
working_urls = sorted([(t, url) for (t, url) in res if t is not None])
7978
times = [t for (t, url) in working_urls]
8079
total = len(times)
8180
if errors:

lmfdb/hecke_algebras/main.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def download_search(info):
115115
s += download_assignment_start[lang] + list_start + '\\\n'
116116
mat_start = "Mat(" if lang == 'gp' else "Matrix("
117117
mat_end = "~)" if lang == 'gp' else ")"
118-
entry = lambda r: "".join([mat_start,str(r),mat_end])
118+
def entry(r): return "".join([mat_start,str(r),mat_end])
119119
# loop through all search results and grab the Hecke operators stored
120120
for c, rr in enumerate(res):
121121
s += list_start
@@ -433,7 +433,7 @@ def download_hecke_algebras_full_lists_op(**args):
433433
c = download_comment_prefix[lang]
434434
mat_start = "Mat(" if lang == 'gp' else "Matrix("
435435
mat_end = "~)" if lang == 'gp' else ")"
436-
entry = lambda r: "".join([mat_start, str(r), mat_end])
436+
def entry(r): return "".join([mat_start, str(r), mat_end])
437437

438438
outstr = c + 'Hecke algebra for Gamma0(%s) and weight %s, orbit label %s. List of Hecke operators T_1, ..., T_%s. Downloaded from the LMFDB on %s. \n\n'%(res['level'], res['weight'], res['orbit_label'],res['num_hecke_op'], mydate)
439439
outstr += download_assignment_start[lang] + '[\\\n'
@@ -453,7 +453,7 @@ def download_hecke_algebras_full_lists_gen(**args):
453453
c = download_comment_prefix[lang]
454454
mat_start = "Mat(" if lang == 'gp' else "Matrix("
455455
mat_end = "~)" if lang == 'gp' else ")"
456-
entry = lambda r: "".join([mat_start,str(r),mat_end])
456+
def entry(r): return "".join([mat_start,str(r),mat_end])
457457

458458
outstr = c + 'Hecke algebra for Gamma0(%s) and weight %s, orbit label %s. List of generators for the algebra. Downloaded from the LMFDB on %s. \n\n'%(res['level'], res['weight'], res['orbit_label'], mydate)
459459
outstr += download_assignment_start[lang] + '[\\\n'
@@ -489,7 +489,7 @@ def download_hecke_algebras_full_lists_mod_op(**args):
489489
field='GF(%s), %s, %s, '%(res['ell'], sqrt(len(res['operators'][0])), sqrt(len(res['operators'][0])))
490490
mat_start = "Mat("+field if lang == 'gp' else "Matrix("+field
491491
mat_end = "~)" if lang == 'gp' else ")"
492-
entry = lambda r: "".join([mat_start,str(r),mat_end])
492+
def entry(r): return "".join([mat_start,str(r),mat_end])
493493

494494
outstr = c + ' List of Hecke operators T_1, ..., T_%s mod %s for orbit %s index %s downloaded from the LMFDB on %s. \n\n'%(len(res['operators']), ell, label, index, mydate)
495495
outstr += download_assignment_start[lang] +'[\\\n'

lmfdb/higher_genus_w_automorphisms/main.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ def split_perm(strg):
126126
startpoint = i+1
127127

128128
def sort_sign(L):
129-
L1 = L[1:]
130-
L1.sort()
129+
L1 = sorted(L[1:])
131130
return [L[0]] + L1
132131

133132
def label_to_breadcrumbs(L):
@@ -505,9 +504,9 @@ def hgcwa_code_download_search(info):
505504
def parse_range2_extend(arg, key, parse_singleton=int, parse_endpoint=None, instance=1):
506505
if parse_endpoint is None:
507506
parse_endpoint = parse_singleton
508-
if type(arg) == str:
507+
if isinstance(arg, str):
509508
arg = arg.replace(' ', '')
510-
if type(arg) == parse_singleton:
509+
if isinstance(arg, parse_singleton):
511510
return [key, arg]
512511
if ',' in arg:
513512
instance = len(arg.split(','))
@@ -526,8 +525,7 @@ def parse_range2_extend(arg, key, parse_singleton=int, parse_endpoint=None, inst
526525
elif 'g' in arg: # linear function of variable g (ax+b)
527526
if GENUS_RE.match(arg):
528527
a = GENUS_RE.match(arg).groups()[0]
529-
genus_list = db.hgcwa_passports.distinct('genus')
530-
genus_list.sort()
528+
genus_list = sorted(db.hgcwa_passports.distinct('genus'))
531529
min_genus = genus_list[0]
532530
max_genus = genus_list[-1]
533531
queries = []

0 commit comments

Comments
 (0)