Skip to content

Commit 1a44223

Browse files
authored
Merge pull request #6440 from LMFDB/main
main -> dev
2 parents 24fafee + 7bfd225 commit 1a44223

49 files changed

Lines changed: 2665 additions & 584 deletions

Some content is hidden

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

.github/workflows/autopep8.yml

Lines changed: 77 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,90 @@ on:
55
jobs:
66
autopep8:
77
runs-on: ubuntu-latest
8+
env:
9+
# Error codes organized following https://pep8.readthedocs.io/en/latest/intro.html#error-codes
10+
#
11+
# E1 - Indentation
12+
# E111 - Fix indentation to be a multiple of four.
13+
# E115 - Fix expected indented block (comment).
14+
#
15+
# E2 - Whitespace
16+
# E211 - Remove extraneous whitespace before '('.
17+
# E222 - Fix multiple spaces after operator.
18+
# E225 - Fix missing whitespace around operator.
19+
# E241 - Fix extraneous whitespace around keywords.
20+
# E242 - Remove extraneous whitespace around operator.
21+
# E251 - Remove whitespace around parameter '=' sign.
22+
# E252 - Missing whitespace around parameter equals.
23+
# E27 - Fix extraneous whitespace around keywords.
24+
#
25+
# E3 - Blank line
26+
# E303 - Remove extra blank lines.
27+
# E304 - Remove blank line following function decorator.
28+
# E306 - Expected 1 blank line before a nested definition.
29+
#
30+
# E4 - Import
31+
# E401 - Put imports on separate lines.
32+
#
33+
# E5 - Line length
34+
# E502 - Remove extraneous escape of newline.
35+
#
36+
# E7 - Statement
37+
# E70 - Put semicolon-separated compound statement on separate lines.
38+
# E701 - Put colon-separated compound statement on separate lines.
39+
# E702 - Put semicolon-separated compound statement on separate lines.
40+
# E711 - Fix comparison with None.
41+
# E712 - Fix comparison with boolean.
42+
# E713 - Use 'not in' for test for membership.
43+
# E714 - Use 'is not' test for object identity.
44+
# E721 - Use "isinstance()" instead of comparing types directly.
45+
# E731 - Use a def when use do not assign a lambda expression.
46+
#
47+
# W2 - Whitespace warning
48+
# W291 - Remove trailing whitespace.
49+
# W292 - Add a single newline at the end of the file.
50+
# W293 - Remove trailing whitespace on blank line.
51+
#
52+
# W3 - Blank line warning
53+
# W391 - Remove trailing blank lines.
54+
#
55+
# W5 - Line break warning
56+
# W504 - Fix line break after binary operator.
57+
#
58+
# W6 - Deprecation warning
59+
# W601 - Use "in" rather than "has_key()".
60+
# W602 - Fix deprecated form of raising exception.
61+
# W603 - Use "!=" instead of "<>"
62+
# W604 - Use "repr()" instead of backticks.
63+
# W605 - Fix invalid escape sequence 'x'.
64+
# W690 - Fix various deprecated code (via lib2to3).
65+
AUTOPEP8_CODES: |
66+
E111,E115,
67+
E211,E222,E225,E241,E242,E251,E252,E27,
68+
E303,E304,E306,
69+
E401,
70+
E502,
71+
E70,E701,E702,E711,E712,E713,E714,E721,E731,
72+
W291,W292,W293,
73+
W391,
74+
W504,
75+
W601,W602,W603,W604,W605,W690
876
steps:
977
- uses: actions/checkout@v2
1078
id: checkout
79+
- name: Process autopep8 codes
80+
id: process_codes
81+
run: |
82+
# Convert multiline codes to single line, removing newlines and extra spaces
83+
PROCESSED_CODES=$(echo "$AUTOPEP8_CODES" | tr -d '\n' | tr -s ' ' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//')
84+
echo "AUTOPEP8_SELECT=$PROCESSED_CODES" >> $GITHUB_ENV
85+
echo "Processed codes: $PROCESSED_CODES"
1186
- name: autopep8
1287
uses: peter-evans/autopep8@v1
1388
if: ${{ github.repository }} == 'LMFDB/lmfdb'
1489
with:
15-
# see generate_autopep8codes.py
16-
# E241 - Fix extraneous whitespace around keywords.
17-
# E242 - Remove extraneous whitespace around operator.
18-
# E251 - Remove whitespace around parameter '=' sign.
19-
# E252 - Missing whitespace around parameter equals.
20-
# E27 - Fix extraneous whitespace around keywords.
21-
# E266 - Fix too many leading '#' for block comments.
22-
# W291 - Remove trailing whitespace.
23-
# W292 - Add a single newline at the end of the file.
24-
# W293 - Remove trailing whitespace on blank line.
25-
# E303 - Remove extra blank lines.
26-
# E304 - Remove blank line following function decorator.
27-
# E306 - Expected 1 blank line before a nested definition.
28-
# W391 - Remove trailing blank lines.
29-
# E401 - Put imports on separate lines.
30-
# E502 - Remove extraneous escape of newline.
31-
# W504 - Fix line break after binary operator.
32-
# W601 - Use "in" rather than "has_key()".
33-
# W602 - Fix deprecated form of raising exception.
34-
# W603 - Use "!=" instead of "<>"
35-
# W604 - Use "repr()" instead of backticks.
36-
# W605 - Fix invalid escape sequence 'x'.
37-
# W690 - Fix various deprecated code (via lib2to3).
38-
# E70 - Put semicolon-separated compound statement on separate lines.
39-
# E701 - Put colon-separated compound statement on separate lines.
40-
# E711 - Fix comparison with None.
41-
# E712 - Fix comparison with boolean.
42-
# E713 - Use 'not in' for test for membership.
43-
# E714 - Use 'is not' test for object identity.
44-
# E721 - Use "isinstance()" instead of comparing types directly.
45-
# E722 - Fix bare except.
46-
# E731 - Use a def when use do not assign a lambda expression.
47-
args: --recursive --in-place --aggressive --select=E241,E242,E251,E252,E266,E27,W291,W292,W293,E303,E304,E306,W391,E401,E502,W504,W601,W602,W603,W604,W605,W690,E70,E701,E711,E712,E713,E714,E721,E722,E731 lmfdb/
90+
# Args using processed environment variable
91+
args: --recursive --in-place --aggressive --select=${{ env.AUTOPEP8_SELECT }} lmfdb/
4892

4993
- name: Create Pull Request
5094
uses: peter-evans/create-pull-request@v3

lmfdb/abvar/fq/isog_class.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ def newton_plot(self):
171171
L = Graphics()
172172
xmax = len(S)
173173
ymax = ZZ(len(S)/2)
174-
pts.append((xmax,0))
175-
L += polygon(pts,alpha=0.1)
176-
pts.remove((xmax,0))
174+
L += polygon(pts+[(0,ymax)],alpha=0.1)
177175
for i in range(xmax+1):
178176
L += line([(i, 0), (i, ymax)], color="grey", thickness=0.5)
179177
for j in range(ymax+1):

lmfdb/abvar/fq/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def short_label(d):
538538

539539
def search_types(self, info):
540540
return self._search_again(info, [
541-
('', 'List of isogeny classes'),
541+
('List', 'List of isogeny classes'),
542542
('Counts', 'Counts table'),
543543
('Random', 'Random isogeny class')])
544544

lmfdb/api2/searchers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def get_info(self):
1818
return utils.get_filtered_fields(self._inv)
1919

2020
def get_inventory(self):
21-
if(self._full_inventory):
21+
if (self._full_inventory):
2222
return self._full_inventory()
2323
return utils.get_filtered_fields(self._inv)
2424

@@ -39,7 +39,7 @@ def auto_search(self, request):
3939
return self.get_search(sd, proj)
4040

4141
def get_search(self, query, projection):
42-
if(self._full_search):
42+
if (self._full_search):
4343
return self._full_search(query, projection)
4444
return utils.simple_search(query, projection)
4545

@@ -88,6 +88,5 @@ def register_singleton(url, table, key=None, simple_search=None, full_search=Non
8888
simple_search -- A function that modifies a query object to make it search for the requested object
8989
full_search -- A function that performs a search itself and returns the results
9090
"""
91-
9291
singletons[url] = {'table':table, 'key':key,
9392
'simple_search':simple_search, 'full_search':full_search}

lmfdb/belyi/test_belyi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def test_download(self):
154154
"/Belyi/download_galmap_to_sage/7T6-7_2.2.1.1.1_3.2.2-a",
155155
follow_redirects=True,
156156
)
157-
assert(
157+
assert (
158158
"phi = 1/2*(7*nu-15)*x^7/(x^7+1/10*(28*nu+7)*x^6+1/100*(-56*nu+511)*x^5+1/40*(-672*nu-1323)*x^4+1/20*(-42*nu-63)*x^3+1/40*(1701*nu+3024)*x^2+1/200*(-6237*nu-11178))"
159159
in page.get_data(as_text=True)
160160
)

lmfdb/characters/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def _dir_knowl_data(label, orbit=False):
587587
parts = label.split('.')
588588
modulus = int(parts[0])
589589
if orbit:
590-
assert(modulus <= ORBIT_MAX_MOD)
590+
assert (modulus <= ORBIT_MAX_MOD)
591591
args = {'type': 'Dirichlet', 'modulus': modulus, 'orbit_label': parts[1]}
592592
else:
593593
number = int(parts[1])

lmfdb/classical_modular_forms/cmf_test_pages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def all_newspaces(self, level, weight):
7575
if dim is None:
7676
for ns in newspaces:
7777
assert ns['dim'] == 0
78-
assert not(newforms)
78+
assert not (newforms)
7979
return []
8080

8181
try:

lmfdb/ecnf/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,8 @@ def __init__(self):
791791
)
792792

793793
tor_opts = ([("", ""),
794-
("[]", "trivial")] +
795-
[disp_tor(tuple(t)) for t in ECNF_stats().torsion_counts if t])
794+
("[]", "trivial")]
795+
+ [disp_tor(tuple(t)) for t in ECNF_stats().torsion_counts if t])
796796
torsion_structure = SelectBox(
797797
name="torsion_structure",
798798
label="Torsion structure",

lmfdb/elliptic_curves/elliptic_curve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
SearchArray, TextBox, SelectBox, SubsetBox, TextBoxWithSelect, CountBox, Downloader,
2121
StatsDisplay, parse_element_of, parse_signed_ints, search_wrap, redirect_no_cache, web_latex_factored_integer)
2222
from lmfdb.utils.interesting import interesting_knowls
23-
from lmfdb.utils.search_columns import SearchColumns, MathCol, LinkCol, ProcessedCol, MultiProcessedCol, CheckCol, FloatCol
23+
from lmfdb.utils.search_columns import SearchColumns, MathCol, LinkCol, ProcessedCol, MultiProcessedCol, CheckCol, FloatCol, ListCol
2424
from lmfdb.utils.common_regex import ZLLIST_RE
2525
from lmfdb.utils.web_display import dispZmat_from_list
2626
from lmfdb.api import datapage
@@ -470,7 +470,7 @@ def make_modcurve_link(label):
470470
ProcessedCol("equation", "ec.q.minimal_weierstrass_equation", "Weierstrass equation", latex_equation, short_title="Weierstrass equation", align="left", orig="ainvs", download_col="ainvs"),
471471
ProcessedCol("modm_images", "ec.galois_rep", r"mod-$m$ images", lambda v: "<span>" + ", ".join([make_modcurve_link(s) for s in v[:5]] + ([r"$\ldots$"] if len(v) > 5 else [])) + "</span>",
472472
short_title="mod-m images", default=lambda info: info.get("galois_image")),
473-
MathCol("mwgens", "ec.mordell_weil_group", "MW-generators", default=False),
473+
ListCol("mwgens", "ec.mordell_weil_group", "MW-generators", mathmode=True, default=False),
474474
])
475475

476476
class ECDownloader(Downloader):

lmfdb/galois_groups/transitive_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def order(self):
120120
return int(self._data['order'])
121121

122122
def gens(self):
123-
return(self._data['gens'])
123+
return (self._data['gens'])
124124

125125
def display_short(self, emptyifnotpretty=False):
126126
if self._data.get('pretty') is not None:
@@ -399,7 +399,7 @@ def group_phrase(n, t):
399399
inf += "A non-solvable"
400400
inf += ' group of order '
401401
inf += str(group['order'])
402-
return(inf)
402+
return (inf)
403403

404404

405405
@cached_function

0 commit comments

Comments
 (0)