Skip to content

Commit

Permalink
Merge pull request #6234 from LMFDB/main
Browse files Browse the repository at this point in the history
Main -> dev
  • Loading branch information
AndrewVSutherland authored Nov 9, 2024
2 parents 643dafc + 1faff7f commit 3226794
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 29 deletions.
3 changes: 2 additions & 1 deletion lmfdb/abvar/fq/isog_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def properties(self):
("$p$-rank", "$%s$" % (self.p_rank)),
# ('Weil polynomial', '$%s$'%(self.formatted_polynomial)),
("Ordinary", "yes" if self.is_ordinary() else "no"),
("Supersingular", "yes" if self.is_supersingular() else "no"),
("Supersingular", "yes" if self.is_supersingular else "no"),
("Simple", "yes" if self.is_simple else "no"),
("Geometrically simple", "yes" if self.is_geometrically_simple else "no"),
("Primitive", "yes" if self.is_primitive else "no"),
Expand Down Expand Up @@ -277,6 +277,7 @@ def frob_angles(self):
def is_ordinary(self):
return self.p_rank == self.g

@property
def is_supersingular(self):
return all(slope == "1/2" for slope in self.polygon_slopes)

Expand Down
4 changes: 2 additions & 2 deletions lmfdb/abvar/fq/templates/show-abvarfq.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h2>Invariants</h2>
{{ KNOWL('av.fq.ordinary',title='not ordinary') }},
{% endif %}

{% if cl.is_supersingular() %}
{% if cl.is_supersingular %}
and {{ KNOWL('av.fq.supersingular',title='supersingular') }}.
{% else %}
and {{ KNOWL('av.fq.supersingular',title='not supersingular')}}.
Expand All @@ -81,7 +81,7 @@ <h2>{{ KNOWL('lf.newton_polygon',title="Newton polygon") }}</h2>
{% if cl.is_ordinary() %}
This isogeny class is {{KNOWL('av.fq.ordinary',title='ordinary')}}.
{% endif %}
{% if cl.is_supersingular() %}
{% if cl.is_supersingular %}
This isogeny class is {{KNOWL('av.fq.supersingular',title='supersingular')}}.
{% endif %}
</p>
Expand Down
7 changes: 5 additions & 2 deletions lmfdb/classical_modular_forms/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,13 @@ def common_parse(info, query, na_check=False):
elif parity == 'odd':
query['char_parity'] = -1
if info.get('level_type'):
if info['level_type'] == 'divides':
if info['level_type'] in ['divides', 'multiple']:
if not isinstance(query.get('level'), int):
raise ValueError("You must specify a single level")
else:
elif info['level_type'] == 'divides':
query['level'] = {'$in': integer_divisors(ZZ(query['level']))}
else:
query['level'] = {'$mod': [0, ZZ(query['level'])]}
else:
query['level_is_' + info['level_type']] = True
parse_floats(info, query, 'analytic_conductor', name="Analytic conductor")
Expand Down Expand Up @@ -1476,6 +1478,7 @@ def __init__(self):
('squarefree', 'squarefree'),
('powerful', 'powerful'),
('divides','divides'),
('multiple','multiple of'),
],
min_width=110)
level = TextBoxWithSelect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ <h2> Newform invariants </h2>
<td>Galois closure of {{ newform.artin_field_display | safe }}</td>
</tr>
{% endif %}
{% if newform.weight == 1 and newform.dim == 1 %}
<tr>
<td>{{ KNOWL('cmf.stark_unit', title='Stark unit')}}:</td>
<td>Root of ${{ newform.stark_minpoly }}$</td>
</tr>
{% endif %}
{% if newform.weight > 1 %}
<tr>
<td>{{ KNOWL('cmf.sato_tate', title='Sato-Tate group') }}: </td>
Expand Down
9 changes: 9 additions & 0 deletions lmfdb/classical_modular_forms/web_newform.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,15 @@ def artin_image_display(self):
def artin_image_knowl(self):
return abstract_group_display_knowl(self.artin_image)

@property
def stark_minpoly(self):
# For now, the only data is for m = b = 1, so we just use lucky.
f = db.mf_stark.lucky({"mf_label": self.label}, "stark_minpoly")
if f is not None:
R = PolynomialRing(ZZ, 'x')
f = R(f)
return latex(f)

def rm_and_cm_field_knowl(self, sign=1):
if self.self_twist_discs:
disc = [ d for d in self.self_twist_discs if sign*d > 0 ]
Expand Down
7 changes: 5 additions & 2 deletions lmfdb/elliptic_curves/elliptic_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,15 @@ def elliptic_curve_search(info, query):
query['num_bad_primes'] = 1
elif info['conductor_type'] == 'squarefree':
query['semistable'] = True
elif info['conductor_type'] == 'divides':
elif info['conductor_type'] in ['divides', 'multiple']:
if not isinstance(query.get('conductor'), int):
err = "You must specify a single conductor"
flash_error(err)
raise ValueError(err)
else:
elif info['conductor_type'] == 'divides':
query['conductor'] = {'$in': integer_divisors(ZZ(query['conductor']))}
else:
query['conductor'] = {'$mod': [0, ZZ(query['conductor'])]}
parse_signed_ints(info, query, 'discriminant', qfield=('signD', 'absD'))
parse_ints(info,query,'rank')
parse_ints(info,query,'adelic_level')
Expand Down Expand Up @@ -1170,6 +1172,7 @@ def __init__(self):
('prime_power', 'p-power'),
('squarefree', 'sq-free'),
('divides','divides'),
('multiple','multiple of'),
],
min_width=85)
cond = TextBoxWithSelect(
Expand Down
3 changes: 3 additions & 0 deletions lmfdb/knowledge/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ def save_form():
NEWID = request.form.get('krename', '').strip()
k = Knowl(ID, saving=True, renaming=bool(NEWID))
new_title = request.form['title']
if not new_title.strip():
flash_error("Title required.")
return redirect(url_for(".show", ID=ID))
new_content = request.form['content']
who = current_user.get_id()
if new_title != k.title or new_content != k.content:
Expand Down
7 changes: 5 additions & 2 deletions lmfdb/modl_galois_representations/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@ def modlgal_search(info, query):
query['conductor_num_primes'] = 1
elif info['conductor_type'] == 'squarefree':
query['conductor_is_squarefree'] = True
elif info['conductor_type'] == 'divides':
elif info['conductor_type'] in ['divides', 'multiple']:
if not isinstance(query.get('conductor'), int):
err = "You must specify a single level"
flash_error(err)
raise ValueError(err)
else:
elif info['conductor_type'] == 'divides':
query['conductor'] = {'$in': integer_divisors(ZZ(query['conductor']))}
else:
query['conductor'] = {'$mod': [0, ZZ(query['conductor'])]}
parse_primes(info, query, 'conductor_primes', name='ramified primes', mode=info.get('conductor_primes_quantifier'))
parse_rats(info, query,'top_slope', qfield='top_slope_real',name='Top slope')
if 'top_slope_real' in query and '/' in info['top_slope']:
Expand Down Expand Up @@ -228,6 +230,7 @@ def __init__(self):
('prime_power', 'p-power'),
('squarefree', 'sq-free'),
('divides','divides'),
('multiple','multiple of'),
],
)
conductor = TextBoxWithSelect(
Expand Down
7 changes: 5 additions & 2 deletions lmfdb/modular_curves/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,15 @@ def modcurve_search(info, query):
query['num_bad_primes'] = 1
elif info['level_type'] == 'squarefree':
query['level_is_squarefree'] = True
elif info['level_type'] == 'divides':
elif info['level_type'] in ['divides', 'multiple']:
if not isinstance(query.get('level'), int):
err = "You must specify a single level"
flash_error(err)
raise ValueError(err)
else:
elif info['level_type'] == 'divides':
query['level'] = {'$in': integer_divisors(ZZ(query['level']))}
else:
query['level'] = {'$mod': [0, ZZ(query['level'])]}
parse_family(info, query, "family", qfield="name")
parse_ints(info, query, "index")
parse_ints(info, query, "genus")
Expand Down Expand Up @@ -757,6 +759,7 @@ def __init__(self):
('prime_power', 'p-power'),
('squarefree', 'sq-free'),
('divides', 'divides'),
('multiple', 'multiple of'),
],
min_width=85)
level = TextBoxWithSelect(
Expand Down
59 changes: 41 additions & 18 deletions lmfdb/static/knowl_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function refresh_link_suggestions() {
var we_define = {};
// bad_intervals is a list of intervals that should be excluded from suggestions: KNOWLS and mathmode
var bad_intervals = [];
var kid = $("input[name='id']").val();
var curcat = kid.split(".", 1)[0];
var content = $kcontent.val();
do {
var m = wedef.exec(content);
Expand Down Expand Up @@ -116,18 +118,17 @@ function refresh_link_suggestions() {
} while (m);
}
// Sort bad_intervals and deal with overlaps (true overlaps shouldn't occur, but nesting might)
function sort_pairs(a, b) {
if (a[0] != b[0]) {
return a[0]-b[0];
} else if (a[1] < b[1]) {
return -1;
} else if (a[1] > b[1]) {
return 1;
} else {
return 0;
function sorter(a, b) {
for (let i = 0; i < Math.min(a.length, b.length); i++) {
if (a[i] < b[i]) {
return -1;
} else if (a[i] > b[i]) {
return 1;
}
}
return a.length - b.length;
}
bad_intervals.sort(sort_pairs);
bad_intervals.sort(sorter);
i = 0;
while (i < bad_intervals.length-1) {
var cur = bad_intervals[i];
Expand Down Expand Up @@ -188,7 +189,14 @@ function refresh_link_suggestions() {
if (found) {
continue;
}
var kdef_finder = new RegExp('\\b'+kdef+'\\b', 'ig');
// Crude effort to handle pluralization
var kdef_sing;
if (kdef.endsWith("s")) {
kdef_sing = kdef.slice(0,-1);
} else {
kdef_sing = kdef;
}
var kdef_finder = new RegExp('\\b'+kdef_sing+'s?\\b', 'ig');
do {
var match = kdef_finder.exec(content);
if (match !== null && !is_bad(match.index)) {
Expand All @@ -200,6 +208,11 @@ function refresh_link_suggestions() {
var match_end = match.index + match[0].length;
var label = match[0];
var klink = knowl_link(definer_id, label);
var kcat = definer_id.split(".", 1)[0]
// We want the current category to come first, so if it matches we change it to a very early ascii character
if (kcat == curcat) {
kcat = "!";
}
// Add five words of context on each side, stopping at newlines
var pre_mark = match.index;
for (var j = 0; j < 5; j++) {
Expand All @@ -210,7 +223,9 @@ function refresh_link_suggestions() {
}
}
var nl_mark = content.lastIndexOf("\n", match.index);
pre_mark = Math.max(pre_mark, nl_mark);
if (nl_mark != -1) {
pre_mark = Math.max(pre_mark, nl_mark);
}
pre_mark = is_bad(pre_mark, -1); // Don't stop in the middle of mathmode/KNOWL
var post_mark = match_end;
for (var j = 0; j < 5; j++) {
Expand All @@ -221,20 +236,23 @@ function refresh_link_suggestions() {
}
}
var nl_mark = content.indexOf("\n", match_end);
post_mark = Math.min(post_mark, nl_mark);
if (nl_mark != -1) {
post_mark = Math.min(post_mark, nl_mark);
}
post_mark = is_bad(post_mark, 1); // Don't stop in the middle of mathmode/KNOWL
var select_link = `<a href="#" class="select_klink" start=`+match.index+` end=`+match_end+`>Select</a>`;
var inserter = `<a href="#" class="insert_klink" definer_id="`+definer_id+`" start=`+match.index+` end=`+match_end+` match="`+match[0]+`">insert `+definer_id+`</a>`;
to_insert.push([match.index, "<li>" + inserter + " &bull; " + content.substring(pre_mark, match.index) + klink + content.substring(match_end, post_mark) + " &bull; " + select_link + "</li>"]);
to_insert.push([kcat, match.index, "<li>" + inserter + " &bull; " + content.substring(pre_mark, match.index) + klink + content.substring(match_end, post_mark) + " &bull; " + select_link + "</li>"]);
}
}
break;
}
} while (match !== null);
}
to_insert.sort(sort_pairs);
to_insert.sort(sorter);
console.log(to_insert);
for (var i = 0; i < to_insert.length; i++) {
var $new_item = $(to_insert[i][1]);
var $new_item = $(to_insert[i][2]);
$linkul.append($new_item);
}
if (!some_link) {
Expand Down Expand Up @@ -404,6 +422,11 @@ function check_knowl_category() {
}

function set_saved() {
unsaved = false;
return true;
var curtitle = $("input[name='title']").val();
if (curtitle.trim().length > 0) {
unsaved = false;
return true;
}
alert("You must enter a title.");
return false;
}

0 comments on commit 3226794

Please sign in to comment.