-
-
Notifications
You must be signed in to change notification settings - Fork 667
Closed
Description
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 Have CombinatorialClass inherits from Parent #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
- Deprecate and remove
CombinatorialClass
- Turn all the factory functions into factory classes by mean of
ClasscallMetaClass
; seePerfectMatching
andTrees
for an advanced example.
- Let
See also: http://wiki.sagemath.org/CombinatorialClass
CC: @sagetrac-sage-combinat
Component: combinatorics
Issue created by migration from https://trac.sagemath.org/ticket/12913