Skip to content

Commit 8716f78

Browse files
roed314claude
andcommitted
Rename British-spelled internal identifiers
Follow-on to the prose pass, kept separate so it can be dropped on its own. Every name here has all of its references inside a single file (or, for favourite_list, one view and its template), so each rename is the definition and its uses together: draw_spectrum.py centre_ratio, y_centre -> center_ratio, y_center WebEllipticCurve.py EC_R_plot's colour parameter -> color web_newform.py factorisation loop variable -> factorization galois_reps.py renormalise_coefficients -> renormalize_coefficients search_wrapper.py query_cancelled_error -> query_canceled_error hecke_algebras favourite_list -> favorite_list (view + template) test_st.py test_favourites -> test_favorites query_cancelled_error is worth a look: it handles psycopg's QueryCanceledError, which spells it with one l, so the handler and the exception now agree. Not renamed: signtocolour, which lmfdb/utils/__init__.py exports in __all__ and five modules import. Renaming it is an API change rather than a spelling fix, so it and the locals built on it (signcolour, thiscolour, colourplus, colourminus, test_signtocolour) are left for a separate decision. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6a12bb3 commit 8716f78

8 files changed

Lines changed: 27 additions & 27 deletions

File tree

lmfdb/classical_modular_forms/web_newform.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,9 @@ def display_hecke_char_polys(self, num_disp=5):
10281028
th_wrap('charpoly', '$F_p(T)$'),
10291029
' </tr>', '</thead>', '<tbody>']
10301030
loop_count = 0
1031-
for p, factorisation in hecke_polys_orbits.items():
1032-
factorisation.sort(key=lambda elt: (elt[0].degree(), elt[1]))
1033-
charpoly = raw_typeset_poly_factor(factorisation, decreasing=True)
1031+
for p, factorization in hecke_polys_orbits.items():
1032+
factorization.sort(key=lambda elt: (elt[0].degree(), elt[1]))
1033+
charpoly = raw_typeset_poly_factor(factorization, decreasing=True)
10341034
if loop_count < num_disp:
10351035
polys.append(' <tr>')
10361036
else:

lmfdb/ecnf/WebEllipticCurve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def EC_R_plot_zone(f,h):
215215
return plot_zone_union(EC_R_plot_zone_piece(f,h,ZF[0],ZF[1]),EC_R_plot_zone_piece(f,h,ZF[2],2*xi-ZF[2]))
216216
return EC_R_plot_zone_piece(f,h,ZF[0],2*ZF[1]-ZF[0])
217217

218-
def EC_R_plot(ainvs, xmin, xmax, ymin, ymax, colour, legend):
218+
def EC_R_plot(ainvs, xmin, xmax, ymin, ymax, color, legend):
219219
x = var('x')
220220
y = var('y')
221221
c = (xmin + xmax) / 2
222222
d = (xmax - xmin)
223-
return implicit_plot(y ** 2 + ainvs[0] * x * y + ainvs[2] * y - x ** 3 - ainvs[1] * x ** 2 - ainvs[3] * x - ainvs[4], (x, xmin, xmax), (y, ymin, ymax), plot_points=500, aspect_ratio="automatic", color=colour) + plot(0, xmin=c - 1e-5 * d, xmax=c + 1e-5 * d, ymin=ymin, ymax=ymax, aspect_ratio="automatic", color=colour, legend_label=legend) # Add an extra plot outside the visible frame because implicit plots are buggy: their legend does not show (https://trac.sagemath.org/ticket/15903)
223+
return implicit_plot(y ** 2 + ainvs[0] * x * y + ainvs[2] * y - x ** 3 - ainvs[1] * x ** 2 - ainvs[3] * x - ainvs[4], (x, xmin, xmax), (y, ymin, ymax), plot_points=500, aspect_ratio="automatic", color=color) + plot(0, xmin=c - 1e-5 * d, xmax=c + 1e-5 * d, ymin=ymin, ymax=ymax, aspect_ratio="automatic", color=color, legend_label=legend) # Add an extra plot outside the visible frame because implicit plots are buggy: their legend does not show (https://trac.sagemath.org/ticket/15903)
224224

225225
Rx = PolynomialRing(RDF,'x')
226226

lmfdb/hecke_algebras/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def hecke_algebras_render_webpage():
4242
weight_list = list(range(2, 20, 2))
4343
lvl_list_endpoints = [1, 100, 200, 300, 400, 500]
4444
lvl_list = ["%s-%s" % (start, end - 1) for start, end in zip(lvl_list_endpoints[:-1], lvl_list_endpoints[1:])]
45-
favourite_list = ["1.12.1","139.2.1","239.2.1","9.16.1"]
46-
info = {'lvl_list': lvl_list,'wt_list': weight_list, 'favourite_list': favourite_list}
45+
favorite_list = ["1.12.1","139.2.1","239.2.1","9.16.1"]
46+
info = {'lvl_list': lvl_list,'wt_list': weight_list, 'favorite_list': favorite_list}
4747
credit = hecke_algebras_credit
4848
t = 'Hecke algebras'
4949
bread = [('HeckeAlgebra', url_for(".hecke_algebras_render_webpage"))]

lmfdb/hecke_algebras/templates/hecke_algebras-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2> Browse {{ KNOWL('hecke_algebra.definition', title='Hecke Algebras') }} for
4040

4141
<p>
4242
Some of our favorite {{ KNOWL('hecke_algebra.definition', title='Hecke Algebras') }}:
43-
{% for rnge in info.favourite_list %}
43+
{% for rnge in info.favorite_list %}
4444
<a href="?label={{rnge}}">&nbsp; {{rnge}} &nbsp;</a>
4545
{% endfor %}
4646
</p>

lmfdb/number_fields/draw_spectrum.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def draw_spec(frobs, local_alg_dict, colors=True, rings=False, num_primes=100, g
6666
bottom_line = round((3/4)*height)
6767

6868
# fraction of height of center line around which the primes in spec are centered
69-
centre_ratio = 1/2 if gaga else 1/4
69+
center_ratio = 1/2 if gaga else 1/4
7070
# y-coordinate of Spec O_K
71-
y_centre = round(centre_ratio*height)
71+
y_center = round(center_ratio*height)
7272

7373
line_thickness = .75
7474

@@ -91,10 +91,10 @@ def draw_spec(frobs, local_alg_dict, colors=True, rings=False, num_primes=100, g
9191
x_coord = (n+1)*x_spread
9292
if l == [0]:
9393
coords.append(ram_coords(
94-
local_alg_dict, p, x_coord, y_centre, y_spread))
94+
local_alg_dict, p, x_coord, y_center, y_spread))
9595
else:
9696
coords.append(unram_coords(
97-
l, x_coord, y_centre, y_spread))
97+
l, x_coord, y_center, y_spread))
9898

9999
# draw Spec Z line at the bottom
100100
if not gaga:
@@ -108,7 +108,7 @@ def draw_spec(frobs, local_alg_dict, colors=True, rings=False, num_primes=100, g
108108
y2=bottom_line))
109109

110110
# a dashed line afterwards to signify generic fiber
111-
for y in (bottom_line, y_centre):
111+
for y in (bottom_line, y_center):
112112
elements.append(
113113
svg.Line(
114114
stroke="black",
@@ -129,7 +129,7 @@ def draw_spec(frobs, local_alg_dict, colors=True, rings=False, num_primes=100, g
129129
text_anchor="middle"))
130130

131131
# draw curves between primes - do this first so points drawn over curve
132-
nextpts = coords if gaga else coords + [[Point(width-2*x_spread, y_centre)]]
132+
nextpts = coords if gaga else coords + [[Point(width-2*x_spread, y_center)]]
133133
for n in range(len(nextpts)-1):
134134
for pt_this in coords[n]:
135135
for pt_next in nextpts[n + 1]:
@@ -184,7 +184,7 @@ def draw_gaga(frobs, local_alg_dict, colors=True) -> svg.SVG:
184184
return draw_spec(frobs, local_alg_dict, colors=colors, gaga=True)
185185

186186

187-
def unram_coords(frob_cycle_list, x_coord, y_centre, spread) -> list:
187+
def unram_coords(frob_cycle_list, x_coord, y_center, spread) -> list:
188188
"""
189189
Given list of Frobenius cycle describing a fixed fiber
190190
with no ramification, evenly spread points.
@@ -195,19 +195,19 @@ def unram_coords(frob_cycle_list, x_coord, y_centre, spread) -> list:
195195
N = sum(l[1] for l in frob_cycle_list)
196196
if N == 1:
197197
cyc_len = frob_cycle_list[0][0]
198-
return [Point(x_coord, y_centre, cyc_len)]
198+
return [Point(x_coord, y_center, cyc_len)]
199199
point_list = []
200200
point_index = 0 # total index of point
201201
for cyc_len, num_repeats in frob_cycle_list:
202202
for _ in range(num_repeats):
203203
y_offset = round(spread * (2 * point_index / (N - 1) - 1))
204-
point = Point(x_coord, y_centre - y_offset, cyc_len)
204+
point = Point(x_coord, y_center - y_offset, cyc_len)
205205
point_list.append(point)
206206
point_index += 1
207207
return point_list
208208

209209

210-
def ram_coords(local_alg_dict, p, x_coord, y_centre, spread, deg=1):
210+
def ram_coords(local_alg_dict, p, x_coord, y_center, spread, deg=1):
211211
""" Given `local_alg_dict` as defined in web_number_field.py, and a prime `p`,
212212
extract the points in the ramified fiber
213213
"""
@@ -225,7 +225,7 @@ def ram_coords(local_alg_dict, p, x_coord, y_centre, spread, deg=1):
225225
y_offset = round(spread * (2 * i / (N - 1) - 1))
226226
else:
227227
y_offset = 0
228-
point = Point(x_coord, y_centre - y_offset, residue_deg, hsl_color(ram_index, max_ram_index))
228+
point = Point(x_coord, y_center - y_offset, residue_deg, hsl_color(ram_index, max_ram_index))
229229
point_list.append(point)
230230

231231
return point_list

lmfdb/sato_tate_groups/test_st.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_trace_zero_density(self):
100100
L = self.tc.get('/SatoTateGroup/?trace_zero_density=19/24')
101101
assert '1.4.F.24.14a' in L.get_data(as_text=True)
102102

103-
def test_favourites(self):
103+
def test_favorites(self):
104104
for label in [ '1.2.1.2.1a','1.2.3.1.1a', '1.4.1.12.4d', '1.4.3.6.2a', '1.4.6.1.1a', '1.4.10.1.1a' ]:
105105
L = self.tc.get('/SatoTateGroup/'+label, follow_redirects=True)
106106
assert "Moment sequences" in L.get_data(as_text=True)

lmfdb/tensor_products/galois_reps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def algebraic_coefficients(self, number_of_terms):
543543
else:
544544
raise ValueError("You asked for a type that we don't have")
545545

546-
def renormalise_coefficients(self):
546+
def renormalize_coefficients(self):
547547
"""
548548
This turns a list of algebraically normalized coefficients
549549
as above into a list of automorphically normalized,
@@ -600,7 +600,7 @@ def lfunction(self):
600600
# take a lot of time. We cut it down and print a warning
601601
number_of_terms = min(self.numcoeff, self.besancon_bound)
602602
self.dirichlet_coefficients = self.algebraic_coefficients(number_of_terms+1)
603-
self.renormalise_coefficients()
603+
self.renormalize_coefficients()
604604

605605
self.texname = "L(s,\\rho)"
606606
self.texnamecompleteds = "\\Lambda(s,\\rho)"

lmfdb/utils/search_wrapper.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def make_query(self, info, random=False):
238238
one_per = [one_per]
239239
return query, sort, table, title, err_title, template, one_per
240240

241-
def query_cancelled_error(
241+
def query_canceled_error(
242242
self, info, query, err, err_title, template, template_kwds
243243
):
244244
ctx = ctx_proc_userdata()
@@ -421,7 +421,7 @@ def __call__(self, info):
421421
split_ors=split_ors,
422422
)
423423
except QueryCanceledError as err:
424-
return self.query_cancelled_error(
424+
return self.query_canceled_error(
425425
info, query, err, err_title, template, template_kwds
426426
)
427427
except SearchParsingError as err:
@@ -644,7 +644,7 @@ def axis_is_boolean(name):
644644
one_per=one_per,
645645
)
646646
except QueryCanceledError as err:
647-
return self.query_cancelled_error(
647+
return self.query_canceled_error(
648648
info, query, err, err_title, template, template_kwds
649649
)
650650
except SearchParsingError as err:
@@ -784,7 +784,7 @@ def __call__(self, info):
784784
tuple(key[i] for i in perm): val for (key, val) in res.items()
785785
}
786786
except QueryCanceledError as err:
787-
return self.query_cancelled_error(
787+
return self.query_canceled_error(
788788
info, query, err, err_title, template, template_kwds
789789
)
790790
else:
@@ -869,7 +869,7 @@ def __call__(self, info):
869869
one_per=one_per,
870870
)
871871
except QueryCanceledError as err:
872-
return self.query_cancelled_error(
872+
return self.query_canceled_error(
873873
info, query, err, err_title, template, template_kwds
874874
)
875875
except SearchParsingError as err:

0 commit comments

Comments
 (0)