Opened 9 years ago
Last modified 3 months ago
#12913 new enhancement
Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories
Reported by: | nthiery | Owned by: | sage-combinat |
---|---|---|---|
Priority: | major | Milestone: | sage-8.0 |
Component: | combinatorics | Keywords: | |
Cc: | sage-combinat | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
All classes that currently inherit from CombinatorialClass
should instead inherit from Parent and register themselves in one of the categories (*EnumeratedSets
, *FiniteEnumeratedSets
, or *InfiniteEnumeratedSets
). For examples, see e.g. FiniteEnumeratedSets().example()
.
- Expected benefits:
- Uniform interface
- Support for TestSuite?
- Support for conversions, coercions, and morphisms, in particular for bijections (as morphisms in the category of Sets with bijection, with properly defined domain and co-domain rather than python functions).
- Steps:
- Let
CombinatorialClass
inherits fromParent
(mostly done #8910) - For each
CombinatorialClass
C:- Have C inherit directly from
Parent
- Ensure that
C.__init__
sets up the proper category (Finite|Infinite)... - Add
TestSuite(C).run()
to the doctests and make all the tests pass - Have a properly setup attribute
C.Element
and useC.element_class
(as defined by the categories) when constructing elements - Ensure proper unique representation behavior by having C inherit both from
UniqueRepresentation
andParent
- Have C inherit directly from
- Deprecate and remove
CombinatorialClass
- Turn all the factory functions into factory classes by mean of
ClasscallMetaClass
; seePerfectMatching
andTrees
for an advanced example.
- Let
Change History (22)
comment:1 Changed 9 years ago by
- Description modified (diff)
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
comment:4 Changed 8 years ago by
Permutations in #14772.
comment:5 Changed 8 years ago by
Integer vectors in #12453.
comment:6 Changed 8 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:7 Changed 8 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:8 Changed 7 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:9 Changed 7 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:10 Changed 4 years ago by
- Milestone changed from sage-6.4 to sage-8.0
Status
git grep -c "import.*CombinatorialClass" src/sage/categories/enumerated_sets.py:1 src/sage/combinat/all.py:1 src/sage/combinat/cartesian_product.py:1 src/sage/combinat/combination.py:1 src/sage/combinat/finite_class.py:1 src/sage/combinat/graph_path.py:1 src/sage/combinat/multichoose_nk.py:1 src/sage/combinat/necklace.py:1 src/sage/combinat/non_decreasing_parking_function.py:1 src/sage/combinat/parking_functions.py:1 src/sage/combinat/partition.py:1 src/sage/combinat/restricted_growth.py:1 src/sage/combinat/root_system/root_lattice_realizations.py:1 src/sage/combinat/sf/ns_macdonald.py:1 src/sage/combinat/species/structure.py:1 src/sage/combinat/symmetric_group_representations.py:1 src/sage/combinat/tuple.py:1 src/sage/combinat/words/shuffle_product.py:1 src/sage/dynamics/flat_surfaces/strata.py:2 src/sage/graphs/linearextensions.py:1 src/sage/sets/family.py:1
comment:11 Changed 4 years ago by
That's actually slightly worse than I thought, but it is good progress. I suspect most of them should be easy changes. From a quick look:
src/sage/combinat/root_system/root_lattice_realizations.py
is easy to fix as per the comment there (which really moves the issue to the EnumeratedSets
category).
However
src/sage/combinat/symmetric_group_representations.py
is harder as the CombinatorialClass
is behaving something between a category and a parent. At least its elements are morphisms from the SGA to a matrix space, but not with the same codomain. Also, I think of a representation as a vector space with an action together. Well, representation theory in Sage is sorely lacking currently and is something I've only been able to work on in a limited capacity so far.
comment:12 Changed 4 years ago by
see #23422
comment:13 Changed 4 years ago by
comment:14 Changed 3 years ago by
#26384 for non-decreasing parking functions
comment:15 Changed 22 months ago by
comment:16 Changed 10 months ago by
remains now
sage/categories/enumerated_sets.py:1sage/combinat/combination.py:1sage/combinat/graph_path.py:1sage/combinat/parking_functions.py:1sage/combinat/shuffle.py:1- sage/combinat/species/structure.py:1
sage/combinat/symmetric_group_representations.py:1sage/combinat/words/shuffle_product.py:1- sage/sets/family.py:1 (easy removal, but must be done at the end)
comment:17 Changed 10 months ago by
comment:18 Changed 10 months ago by
@chapoton: concerning the species problem, would you be interested in participating in an online species workshop in February - both as mathematician and as sagemath aficionado?
comment:19 Changed 9 months ago by
Oh, there seems to remains more with sub-classes (including MapCombinatorialClass
) in
src/sage/categories/enumerated_sets.py src/sage/combinat/combinat.py
comment:20 Changed 6 months ago by
deprecating the unused variants in #31545
comment:21 Changed 3 months ago by
- Summary changed from Deprecate CombinatorialClass in favor of the EnumeratedSet's categories to Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories
comment:22 Changed 3 months ago by
I have opened #32121 for MapCombinatorialClass
.
Part of the work is done in #13605 (
partition.py
) and #14063 (compositions). More to come.