Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EllipticCurve: Raise error on unexpected keyword argument #38361

Merged
merged 6 commits into from
Sep 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix failing tests
user202729 committed Jul 20, 2024
commit caab6cb170059ec3ae86ab6bb0b1ba965836702a
14 changes: 13 additions & 1 deletion src/sage/schemes/elliptic_curves/constructor.py
Original file line number Diff line number Diff line change
@@ -438,6 +438,9 @@ def create_key_and_extra_args(self, x=None, y=None, j=None, minimal_twist=True,
# Interpret x as a Cremona or LMFDB label.
from sage.databases.cremona import CremonaDatabase
x, data = CremonaDatabase().coefficients_and_data(x)
# data is only valid for elliptic curves over QQ.
if R not in (None, QQ):
data = {}
# User-provided keywords may override database entries.
data.update(kwds)
kwds = data
@@ -457,7 +460,7 @@ def create_key_and_extra_args(self, x=None, y=None, j=None, minimal_twist=True,

return (R, tuple(R(a) for a in x)), kwds

def create_object(self, version, key, **kwds):
def create_object(self, version, key, *, names=None, **kwds):
r"""
Create an object from a ``UniqueFactory`` key.

@@ -467,6 +470,15 @@ def create_object(self, version, key, **kwds):
sage: type(E)
<class 'sage.schemes.elliptic_curves.ell_finite_field.EllipticCurve_finite_field_with_category'>

``names`` is ignored at the moment, however it is used to support a convenient way to get a generator::

sage: E.<P> = EllipticCurve(QQ, [1, 3])
sage: P
(-1 : 1 : 1)
sage: E.<P> = EllipticCurve(GF(5), [1, 3])
sage: P
(4 : 1 : 1)

.. NOTE::

Keyword arguments are currently only passed to the
2 changes: 1 addition & 1 deletion src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py
Original file line number Diff line number Diff line change
@@ -2412,7 +2412,7 @@ def __init__(self, Q, R=None, invert_y=True):
if not hasattr(self, '_curve'):
if self._Q.degree() == 3:
ainvs = [0, self._Q[2], 0, self._Q[1], self._Q[0]]
self._curve = EllipticCurve(ainvs, check_squarefree=R.is_field())
self._curve = EllipticCurve(ainvs)
else:
self._curve = HyperellipticCurve(self._Q, check_squarefree=R.is_field())