-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
coerce vs _coerce_ vs _coerce_c #33497
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
New commits:
|
Commit: |
Branch: u/vdelecroix/33497 |
comment:4
This is definitely a step in the right direction. So +1 on this ticket. Definitely in the documentation it would be good to use |
comment:5
Currently there is an indirection :
|
comment:6
I see. Thanks. So every parent that you changed already has an |
comment:7
I did not modify any parent. If tests pass, then all parents that are tested have an element constructor... |
comment:8
I wasn’t be precise enough, but for the parents that you call I am not sure that is a good thing that there is the element constructor and using the old coercion system as it means it is half way between the two, but that is not so relevant. |
comment:9
Should I add a warning when the element constructor is not implemented? ie diff --git a/src/sage/structure/parent_old.pyx b/src/sage/structure/parent_old.pyx
index 630f0ca861..02c3423a0b 100644
--- a/src/sage/structure/parent_old.pyx
+++ b/src/sage/structure/parent_old.pyx
@@ -39,7 +39,8 @@ from cpython.bool cimport *
cdef inline check_old_coerce(Parent p):
if p._element_constructor is not None:
raise RuntimeError("%s still using old coercion framework" % p)
-
+ from warnings import warn
+ warn("{} does not implement element_constructor".format(p), RuntimeWarning)
cdef class Parent(parent.Parent):
""" |
comment:10
That is a good idea for a way to check. My guess is there are still parents that use that. However, I suspect there are parents that do not implement it since it is something that comes from using the new style The change |
comment:11
It seems to me that only multivariate polynomial rings are going through the old coercion framework
|
comment:12
Then perhaps we can just leave those calls to Also, the patchbot seems to report an infinite loop in
|
comment:13
Yes, there is something going wrong in "monsky_washnitzer", probably (at least) in the class
which has no element constructor. Maybe it would also help to add a method "one" to this ring ? EDIT: adding "one" does not fix the infinite recursion |
comment:14
I pushed to trac a rough branch (public/monsky_coercion) where I tried to convert the Monsky-Washnitser file to the current coercion system. Not yet working, but possibly close to. Maybe Travis would know better what to do. |
comment:15
I have made #33525 for the Monsky problem. |
comment:16
I would suggest not to touch the file |
comment:17
so here is a branch just the same but with no changes in monsky New commits:
|
Changed branch from u/vdelecroix/33497 to public/ticket/33497 |
Dependencies: #33525 |
comment:29
Morally green bot (pyflakes warnings are not introduced on this ticket). |
comment:30
Ping. Should we try to get this into the next Sage release or wait for the next beta0? |
comment:31
Would be great to have it in the next release! It is a major step forward in using |
comment:32
Only my latest changes need to be reviewed as I have reviewed Frédéric's and (re-)reviewed yours (as Frédéric likely already reviewed yours). If mine are good, then it is a positive review. |
Reviewer: Frédéric Chapoton, Travis Scrimshaw |
Changed reviewer from Frédéric Chapoton, Travis Scrimshaw to Frédéric Chapoton, Travis Scrimshaw, Vincent Delecroix |
comment:33
Looks good to me. |
Changed author from Vincent Delecroix to Vincent Delecroix, Travis Scrimshaw, |
comment:35
Thank you. |
comment:36
Merge failure on top of: 5a999eb Trac #33468: Feature for gfan b389f97 Trac #33466: sage.features.lrs: Make it a JoinFeature of Lrs, LrsNash; use Executable.absolute_filename 204cbf0 Trac #33017: LazyImport.instancecheck, subclasscheck: Return False on ImportError ae06fa4 Trac #31802: Bug in plotting 3d polyhedron with rays, add option polygon='rainbow' 0553c9b Trac #30749: Characteristic polynomial of central Hyperplane arrangement returns wrong result? 2317d5d Trac #30411: src/tox.ini: Add environment pyright cf219d6 Trac #33661: Don't test files created by jupyter-sphinx 770a894 Trac #33642: Update build/pkgs/matplotlib/install-requires.txt and distros/conda.txt a442962 Trac #33638: GH Actions: Fix cygwin 0a5029c Trac #33430: GH Actions: Fix homebrew-maximal, remove opensuse-15.2.1 7ee048c Trac #33426: add more details on conda-based installations of Sage 7acdc3d Trac #33246: canonical_label returns incorrect partite sets 6df7b36 Trac #33063: notebook: update to 6.4.10 to fix deprecation warning 365d2b1 Trac #33650: Set JUPYTER_DATA_DIR etc. during docbuild b2ddb07 Trac #33635: fixing the broken linter, again c489291 Trac #33632: fix indentation (E111) in pyx files in numerical/ a837fee Trac #33626: sageinspect.sage_getfile(x) incorrect when using an alternate suffix for extension modules 216d60b Trac #33633: fix indentation (E111) in pyx files in graphs, libs, proba 39d402c Trac #33629: add negative for continued fractions 4955762 Trac #33565: Add CODE_OF_CONDUCT.md to the repo 00bc510 Trac #33560: pytest: ignore cython files a02eec3 Trac #33582: clean up docstring formatting in schemes/elliptic_curves/ 31995b7 Trac #33618: docbuild: typo in arguments check leads to confusing error 94a131c Trac #33612: sage.matrix.matrix_space: Rename a test_... function to test... (with deprecation) 823194c Trac #33605: cbc: Add system package information for gentoo, nix 6eb1f67 Trac #33593: fix W391 in groups/ and algebras/ 5ec6108 Trac #33571: Correct wrong paths in the developer's guide b886d89 Trac #33628: Fig bug in graphs.RandomToleranceGraph 5ee8a50 Trac #33616: Simplify inventory builder 0a7c8f4 Trac #33615: full cleanup of modules/fp_graded/ 97533a7 Trac #33589: Gitpod: track remote trac branch b8d5371 Trac #33576: Modernize coercion for SpecialHyperellipticQuotientRing 55da3e1 Trac #33572: sage -pytest 2f104e6 Trac #33533: Update nbconvert to 6.4.x, add optional package pyppeteer 7a5714a Trac #33366: BipartiteGraph() fails to create graph from graph6 string dfd98a7 Trac #31006: Add more typing information to manifold package 360ee4c Trac #30540: Add package phitigra: Graph editor that works with Jupyter 3f93cd0 Trac #29640: Create an AUTHORS.md file with links d8f76fb Trac #33624: doctest unnecessarily assumes SAGE_VENV/bin contains b438a78 Trac #33608: Building documentation is broken in Sage 9.6.beta6 88e25dd Trac #33631: Github workflow: Fix pyright 78bfb6c Updated SageMath version to 9.6.beta7 author 'Vincent Delecroix, Travis Scrimshaw,' does not look right |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:39
I am not getting any merge failure on 9.6.rc1. Although I guess this is probably too late to be merged into 9.6, so I guess we just have to wait for 9.7.beta0... |
Changed author from Vincent Delecroix, Travis Scrimshaw, to Vincent Delecroix, Travis Scrimshaw |
comment:40
The failure was actually just "author 'Vincent Delecroix, Travis Scrimshaw,' does not look right". You just fixed that. |
Changed branch from public/ticket/33497 to |
Even though the
_coerce_
and_coerce_c
methods are only implemented in the soon to be deprecatedsage.structure.parent_old.Parent
it is still used in some places. The current situation prevents to build a ring that inherits from Parent and use it as a base ring for the multivariate polynomial ring.We replace all usage of
_coerce_
/_coerce_c
bycoerce
and deprecate the formers.Depends on #33525
Depends on #33576
Depends on #33558
CC: @mezzarobba
Component: algebra
Author: Vincent Delecroix, Travis Scrimshaw
Branch/Commit:
4ed53f8
Reviewer: Frédéric Chapoton, Travis Scrimshaw, Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/33497
The text was updated successfully, but these errors were encountered: