-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Update to new conway-polynomials python package #36765
Conversation
There's now a python package providing a standard interface to this data.
@@ -152,7 +144,7 @@ def __len__(self): | |||
|
|||
sage: c = ConwayPolynomials() | |||
sage: len(c) | |||
35352 | |||
35357 | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh? What happened there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was asking myself the same question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inflation.
The old package came with preprocessed data that would have been harder to diff against the upstream list for changes. I think it was just a tiny bit out-of-date. Here's the diff:
103a104
> [2,110,[1,1,1,0,0,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,1,1,0,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,0,0,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]],
219a221
> [3,52,[2,0,1,1,1,2,0,1,2,0,0,0,1,0,2,0,2,2,2,1,2,0,2,1,0,0,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]],
222a225,226
> [3,56,[2,2,0,0,0,1,0,2,0,0,0,0,2,1,1,0,0,1,2,2,2,2,0,2,2,1,2,2,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]],
> [3,57,[1,1,2,2,2,2,1,0,1,1,0,2,1,0,2,2,2,1,0,2,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]],
229a234
> [3,72,[2,2,0,2,1,1,1,2,1,0,2,1,2,1,0,1,0,2,1,1,0,2,1,2,1,2,0,2,0,1,1,1,2,2,1,0,2,2,1,1,0,0,1,2,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]],
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Does upstream update the list "often"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea. There's no change history on the site, but the new package ships the upstream file unmodified so at least we can git diff
it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shipping upstream file unmodified sounds very good to me. I think it is ready.
Add back the "conway_polynomials: " prefix in the header to fix the package's inclusion into the TOC.
7a1fada
to
4b45b63
Compare
isn't this duplicating data available from GAP ? |
We discussed that in #32747. |
|
This fixes a failing doctest describing the database.
This fixes a failing doctest for the description of the Conway polynomials database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working on this!
No problem, thanks for the help. I'll work on the others as time permits. We're in the single-digits now for missing Gentoo packages and zero is starting to look possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for working on this.
The conda tests are failing, e.g. because of
File "src/sage/combinat/designs/database.py", line 820, in sage.combinat.designs.database.OA_9_135
Failed example:
OA = OA_9_135() # needs sage.rings.finite_rings sage.schemes
Exception raised:
Traceback (most recent call last):
File "/home/runner/work/sage/sage/src/sage/doctest/forker.py", line 709, in _run
self.compile_and_execute(example, compiler, test.globs)
File "/home/runner/work/sage/sage/src/sage/doctest/forker.py", line 1144, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.combinat.designs.database.OA_9_135[2]>", line 1, in <module>
OA = OA_9_135() # needs sage.rings.finite_rings sage.schemes
File "/home/runner/work/sage/sage/src/sage/combinat/designs/database.py", line 837, in OA_9_135
G,B = singer_difference_set(16,2)
File "/home/runner/work/sage/sage/src/sage/combinat/designs/difference_family.py", line 390, in singer_difference_set
c = conway_polynomial(p,e*(d+1))
File "/home/runner/work/sage/sage/src/sage/rings/finite_rings/conway_polynomials.py", line 63, in conway_polynomial
return R(ConwayPolynomials()[p][n])
File "/home/runner/work/sage/sage/src/sage/databases/conway.py", line 96, in __init__
import conway_polynomials
ModuleNotFoundError: No module named 'conway_polynomials'
So we need to also create a conda feedstock for it.
I think we can also remove the conway_polynomials feature (these failures show that it's presence or absence doesn't really imply anything).
src/sage/features/databases.py
Outdated
spkg='conway_polynomials', | ||
description="Frank Luebeck's database of Conway polynomials", | ||
type='standard') | ||
PythonModule.__init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PythonModule.__init__( | |
super().__init__( |
(not that it is that important)
Right, conway-polynomials needs to be added to "install-requires" in src/setup.cfg.m4 Adding conda packaging is a downstream activity and not the burden of the PR author |
conway_polynomials is a python package now and can be depended upon via the python tooling.
The conway_polynomials package is now a standard python dependency of sagelib and does not need to be detected at runtime.
The feature detection for Conway polynomials was removed; they're always installed via a python package now.
How is that a downstream activity if we are the ones offering the package?! |
Upstream = offers source repo and PyPI package Downstream = provides Debian, Fedora, OpenSuSE, Arch Linux, Conda, Gentoo, ... packaging. |
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR, | ||
POLYTOPE_DATA_DIR) | ||
|
||
|
||
class DatabaseConwayPolynomials(StaticFile): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I think we would say that this is API and should not be removed without deprecation. But I don't object to removing it
It's now available on conda-forge, so it should work now once you added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We should update this to v0.8 first but my sage has been occupied all day running gap tests. |
Documentation preview for this PR (built with commit 1685d81; changes) is ready! 🎉 |
Fix sagemath#32747 by switching to the newly-minted [conway-polynomials package](https://pypi.org/project/conway-polynomials/0.7/) on pypi. IMO `sage.databases.conway` (which makes the dict immutable by wrapping it in a class) is of dubious value but I've left everything alone for now. URL: sagemath#36765 Reported by: Michael Orlitzky Reviewer(s): François Bissey, Matthias Köppe, Michael Orlitzky, Tobias Diez
Fix #32747 by switching to the newly-minted conway-polynomials package on pypi.
IMO
sage.databases.conway
(which makes the dict immutable by wrapping it in a class) is of dubious value but I've left everything alone for now.