Skip to content

Meta-ticket: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories #12913

@nthiery

Description

@nthiery

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:
    1. Let CombinatorialClass inherits from Parent (mostly done Have CombinatorialClass inherits from Parent #8910)
    2. 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 use C.element_class (as defined by the categories) when constructing elements
    • Ensure proper unique representation behavior by having C inherit both from UniqueRepresentation and Parent
    1. Deprecate and remove CombinatorialClass
    2. Turn all the factory functions into factory classes by mean of ClasscallMetaClass; see PerfectMatching and Trees for an advanced example.

See also: http://wiki.sagemath.org/CombinatorialClass

CC: @sagetrac-sage-combinat

Component: combinatorics

Issue created by migration from https://trac.sagemath.org/ticket/12913

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions