Skip to content

Commit a39da67

Browse files
roed314claude
andcommitted
Add completeness regressions for the maxp and Galois-specific paths
The existing regression only reached clear_S through an explicit ramps constraint and only exercised _nSp. Add cases for the maxp route through get_S (both the range form and the top-level $or produced by parsing maxp=2,5-23) and for the Galois-specific _nSGp branch, plus the matching incomplete case showing the num_ram bound is essential there. The $or reason is assembled from a set, so its clause order is unstable; that case checks for the phrase rather than the whole string. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7ecb5be commit a39da67

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lmfdb/tests/test_utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ def test_complete(self):
343343
("nf_fields", {'degree': 5, 'galois_label': '5T4', 'gal_is_abelian': True, 'disc_abs': 920627786839041}, "number fields with incompatible conditions: Galois group"),
344344
("nf_fields", {'degree': 5, 'galois_label': '5T4', 'disc_rad': 1254}, "number fields with degree 5, Galois group 5T(1,2,4), unramified outside {2,3,11,19}"),
345345
("nf_fields", {'degree': 5, 'num_ram': 1, 'ramps': {'$containedin': [2, 3, 5, 7, 11, 13]}}, "number fields with degree 5, unramified outside {2,3,5,7,11,13}, at most 1 ramified prime"),
346+
("nf_fields", {'degree': 5, 'num_ram': 1, 'maxp': {'$gte': 5, '$lte': 23}}, "number fields with degree 5, unramified outside {2,3,5,7,11,13,17,19,23}, at most 1 ramified prime"),
347+
("nf_fields", {'degree': 8, 'galois_label': '8T25', 'num_ram': 1, 'ramps': {'$containedin': [2, 3, 5, 7, 11, 13]}}, "number fields with degree 8, Galois group 8T25, unramified outside {2,3,5,7,11,13}, at most 1 ramified prime"),
346348
("nf_fields", {'degree': 8, 'galois_label': '8T25', 'rd': {'$gte': 1, '$lte': 100}}, "number fields with degree 8, Galois group 8T(25,36), Galois root discriminant at most 200"),
347349
("nf_fields", {'degree': 2, 'r2': 0, 'regulator': {'$gte': 0, '$lte': 7}}, "number fields with degree 2, signature [2,0], regulator less than 7.25"),
348350
("nf_fields", {'degree': 2, 'r2': 1, 'regulator': {'$gte': 0, '$lte': 0.999}}, "number fields with degree 2, signature [0,1], regulator less than 1.00"),
@@ -388,6 +390,16 @@ def test_complete(self):
388390
tbl, query, reason, caveat = tup
389391
self.assertEqual(results_complete(tbl, query, db), (True, reason, caveat))
390392

393+
# The search maxp=2,5-23 parses to a top-level $or, giving a reason built from
394+
# several clauses; since these are collected in a set we only check for inclusion.
395+
complete, reason, caveat = results_complete(
396+
"nf_fields",
397+
{'degree': 5, 'num_ram': 1, '$or': [{'maxp': 2}, {'maxp': {'$gte': 5, '$lte': 23}}]},
398+
db)
399+
self.assertTrue(complete)
400+
self.assertIn("at most 1 ramified prime", reason)
401+
self.assertIsNone(caveat)
402+
391403
for tbl, query in [
392404
("maass_rigor", {"level": {"$gte":2, "$lte": 5}, "spectral_parameter": {"$lte": 21}}),
393405
("mf_newforms", {'level': {'$gte': 100, '$lte': 200}, 'weight': {'$gte': 20, '$lte': 30}}),
@@ -396,6 +408,7 @@ def test_complete(self):
396408
("ec_nfcurves", {'field_label': '7.7.20134393.1', 'conductor_norm': {'$gte': 1, '$lte': 50}}),
397409
("nf_fields", {'degree': 6, 'disc_abs': {'$gte': 1, '$lte': 20000000}}),
398410
("nf_fields", {'degree': 5, 'ramps': {'$containedin': [2, 3, 5, 7, 11, 13]}}),
411+
("nf_fields", {'degree': 8, 'galois_label': '8T25', 'ramps': {'$containedin': [2, 3, 5, 7, 11, 13]}}),
399412
("nf_fields", {'degree': 2, 'r2': 1, 'regulator': 1}),
400413
("nf_fields", {'degree': 4, 'r2': 2, 'regulator': {'$gte': 0.962, '$lte': 0.963}}), # Infinitely many degree 4 CM fields with regulator 0.962423650119
401414
("nf_fields", {'degree': 6, 'r2': 3, 'regulator': {'$gte': 2.101, '$lte': 2.102}}), # Infinitely many degree 6 CM fields with regulator 2.10181872849

0 commit comments

Comments
 (0)