Opened 11 months ago
Last modified 3 weeks ago
#33384 new enhancement
Deprecate global imports of CombinatorialObject, CombinatorialClass, MapCombinatorialClass
Reported by: | Matthias Köppe | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.9 |
Component: | combinatorics | Keywords: | |
Cc: | Travis Scrimshaw, Frédéric Chapoton | Merged in: | |
Authors: | Matthias Koeppe | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | u/mkoeppe/deprecate_global_imports_of_combinatorialobject__combinatorialclass__mapcombinatorialclass (Commits, GitHub, GitLab) | Commit: | 1d3a09baf94a54112382f06acacb098c9f186d27 |
Dependencies: | Stopgaps: |
Description (last modified by )
Part of #12913 (Meta-ticket: Deprecate CombinatorialClass
in favor of the EnumeratedSet
's categories)
Change History (9)
comment:1 Changed 11 months ago by
Branch: | → u/mkoeppe/deprecate_global_imports_of_combinatorialobject__combinatorialclass__mapcombinatorialclass |
---|
comment:2 Changed 11 months ago by
Authors: | → Matthias Koeppe |
---|---|
Commit: | → 81fcc921a5a35f3fd0a02bc8ccb6373dbd76af41 |
Description: | modified (diff) |
comment:3 Changed 11 months ago by
Commit: | 81fcc921a5a35f3fd0a02bc8ccb6373dbd76af41 → 1d3a09baf94a54112382f06acacb098c9f186d27 |
---|
Branch pushed to git repo; I updated commit sha1. New commits:
d4810bf | src/sage/misc/persist.pyx: Import CombinatorialObject in doctest here
|
ad521cf | src/sage/combinat/combinat.py: Add deprecation warning in doctest output
|
1d3a09b | src/sage/combinat/combinat.py: Explicitly import CombinatorialClass in some doctests
|
comment:4 Changed 11 months ago by
The deprecation via lazy imports unfortunately does not work very well:
sage -t --random-seed=332440843511251861710123815794934176969 src/sage/combinat/combinat.py ********************************************************************** File "src/sage/combinat/combinat.py", line 1198, in sage.combinat.combinat.CombinatorialObject.__eq__ Failed example: class Bar(Element, CombinatorialObject): def __init__(self, l): CombinatorialObject.__init__(self, l) Exception raised: Traceback (most recent call last): File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-gcc11/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 694, in _run self.compile_and_execute(example, compiler, test.globs) File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-gcc11/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute exec(compiled, globs) File "<doctest sage.combinat.combinat.CombinatorialObject.__eq__[7]>", line 1, in <module> class Bar(Element, CombinatorialObject): TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
comment:5 Changed 11 months ago by
Cc: | Travis Scrimshaw Frédéric Chapoton added |
---|
comment:6 Changed 11 months ago by
Hmm...that is a bit strange. Perhaps something is not being resolved correctly? I don't know from a quick look what is going on. However, +1 for doing this ticket.
comment:7 Changed 10 months ago by
Milestone: | sage-9.6 → sage-9.7 |
---|
comment:8 Changed 5 months ago by
Milestone: | sage-9.7 → sage-9.8 |
---|
comment:9 Changed 3 weeks ago by
Milestone: | sage-9.8 → sage-9.9 |
---|
Note: See
TracTickets for help on using
tickets.
New commits:
src/sage/combinat/all.py: Deprecate the global imports of CombinatorialObject, CombinatorialClass, MapCombinatorialClass
src/doc/en/developer/coding_basics.rst: Replace use of CombinatorialObject in doctest