Skip to content

Commit 7cf2738

Browse files
author
Release Manager
committed
sagemathgh-39179: Fix CremonaDatabase constructor <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#39072 Alternative to sagemath#39116. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39179 Reported by: Kwankyu Lee Reviewer(s): Kwankyu Lee, Marc Culler, Tobias Diez, user202729
2 parents bc1da20 + 011e07f commit 7cf2738

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

src/sage/databases/cremona.py

+26-7
Original file line numberDiff line numberDiff line change
@@ -1682,21 +1682,40 @@ def CremonaDatabase(name=None, mini=None, set_global=None):
16821682
FeatureNotPresentError: database_should_not_exist_ellcurve is not available.
16831683
'...db' not found in any of [...]
16841684
...Further installation instructions might be available at https://github.com/JohnCremona/ecdata.
1685+
1686+
Verify that :issue:`39072` has been resolved::
1687+
1688+
sage: C = CremonaDatabase(mini=False) # optional - !database_cremona_ellcurve
1689+
Traceback (most recent call last):
1690+
...
1691+
ValueError: full Cremona database is not available; consider using mini Cremona database by mini=True
16851692
"""
16861693
if set_global is not None:
16871694
from sage.misc.superseded import deprecation
16881695
deprecation(25825, "the set_global argument for CremonaDatabase is deprecated and ignored")
1696+
16891697
if name is None:
1690-
if DatabaseCremona().is_present():
1691-
name = 'cremona'
1692-
else:
1698+
if mini is None:
1699+
if DatabaseCremona().is_present():
1700+
name = 'cremona'
1701+
mini = False
1702+
else:
1703+
name = 'cremona mini'
1704+
mini = True
1705+
elif mini:
16931706
name = 'cremona mini'
1694-
if name == 'cremona':
1695-
mini = False
1707+
else:
1708+
if not DatabaseCremona().is_present():
1709+
raise ValueError('full Cremona database is not available; '
1710+
'consider using mini Cremona database by mini=True')
1711+
name = 'cremona'
16961712
elif name == 'cremona mini':
16971713
mini = True
1698-
if mini is None:
1699-
raise ValueError('mini must be set as either True or False')
1714+
elif name == 'cremona':
1715+
mini = False
1716+
else:
1717+
if mini is None:
1718+
raise ValueError('mini must be set as either True or False')
17001719

17011720
if mini:
17021721
return MiniCremonaDatabase(name)

0 commit comments

Comments
 (0)