#12913: Deprecate CombinatorialClass in favor of the EnumeratedSet's categories
---------------------------------+------------------------------------------
Reporter: nthiery | Owner: sage-combinat
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.1
Component: combinatorics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Description changed by nthiery:
Old 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:
> 1. Let {{{CombinatorialClass}}} inherits from {{{Parent}}} (mostly done
> #8910)
> 1. 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}}}
> 1. Turn all the factory functions into factory classes by mean of
> {{{ClasscallMetaClass}}}; see {{{PerfectMatching}}} and {{{Trees}}} for
> an advanced example.
New 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:
1. Let {{{CombinatorialClass}}} inherits from {{{Parent}}} (mostly done
#8910)
1. 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}}}
1. 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
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12913#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.