Closed
Conversation
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
Co-authored-by: edgarcosta <322822+edgarcosta@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error searching for ECQ multiple of conductor
Handle $mod operator in completeness checks
Feb 2, 2026
Contributor
|
What's the status of this PR? There's now yet another bugreport about someone trying to search with $mod and an error coming up. |
Member
|
I'm not thrilled with this solution, which is why I didn't initially approve it. Then I got distracted. Here's an example of the kind of output that I think may end up biting us in the future: I'll try to think of a different way to solve this issue. |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Searches for "multiple of" conductor/level crash with
ValueError: Unsupported key $modin completeness checking. Theto_rset()function converts query operators to RealSets but lacks support for psycodict's$modoperator.Changes
lmfdb/utils/completeness.py: Added
$modoperator handling into_rset(). Since$modrepresents unbounded arithmetic progressions, treat as full real line, causing completeness checks to correctly return False.lmfdb/tests/test_utils.py: Added unit tests for
$modoperator and integration tests with elliptic curve/modular form queries.Technical Notes
psycodict uses
{'$mod': [remainder, divisor]}format (opposite of MongoDB). Example:{'$mod': [0, 7]}matches multiples of 7 (wherevalue % 7 == 0).Affected searches:
/EllipticCurve/Q/?conductor_type=multiple&conductor=7/ModularForm/GL2/Q/holomorphic/?level_type=multiple&level=23Original prompt
This section details on the original issue you should resolve
<issue_title>Error searching for ECQ multiple of conductor</issue_title>
<issue_description>Searching for "multiple of" in the conductor field (e.g. take 7) in
https://www.lmfdb.org/EllipticCurve/Q/?search_type=
gives an error:
https://www.lmfdb.org/EllipticCurve/Q/?conductor_type=multiple&conductor=7
Comments on the Issue (you are @copilot in this section)
@jenpaulhus This issue comes during the check for completeness of the particular search.The feature on the ECQ pages requires $mod and that's where the error is coming from in utils/completeness.py
Exception on /ModularForm/GL2/Q/holomorphic/ [GET]
Traceback (most recent call last):
File "/home/sage/sage-10.5/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sage/sage-10.5/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sage/sage-10.5/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sage/sage-10.5/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lmfdb/lmfdb-git-web/lmfdb/classical_modular_forms/main.py", line 172, in index
return newform_search(info)
^^^^^^^^^^^^^^^^^^^^
File "/home/lmfdb/lmfdb-git-web/lmfdb/utils/search_wrapper.py", line 274, in call
complete, msg, caveat = result...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.