-
-
Notifications
You must be signed in to change notification settings - Fork 685
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
CombinatorialClassinherits fromParent(mostly done Have CombinatorialClass inherits from Parent #8910) - For each
CombinatorialClassC:
- 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.Elementand useC.element_class(as defined by the categories) when constructing elements - Ensure proper unique representation behavior by having C inherit both from
UniqueRepresentationandParent
- Deprecate and remove
CombinatorialClass - Turn all the factory functions into factory classes by mean of
ClasscallMetaClass; seePerfectMatchingandTreesfor 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