Opened 5 years ago

Last modified 3 years ago

#12913 new enhancement

Deprecate CombinatorialClass in favor of the EnumeratedSet's categories

Reported by: nthiery Owned by: sage-combinat
Priority: major Milestone: sage-6.4
Component: combinatorics Keywords:
Cc: sage-combinat Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by 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 #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
    3. Deprecate and remove CombinatorialClass
    4. 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

Change History (9)

comment:1 Changed 5 years ago by nthiery

  • Description modified (diff)

comment:2 Changed 4 years ago by tscrim

Part of the work is done in #13605 (partition.py) and #14063 (compositions). More to come.

comment:3 Changed 4 years ago by tscrim

More work:

comment:4 Changed 4 years ago by tscrim

Permutations in #14772.

comment:5 Changed 4 years ago by tscrim

Integer vectors in #12453.

comment:6 Changed 4 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:7 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:9 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.