#14138: some cleanup in sage.combinat.combinat
---------------------------------+------------------------------------------
       Reporter:  ncohen         |         Owner:  sage-combinat        
           Type:  defect         |        Status:  needs_review         
       Priority:  major          |     Milestone:  sage-5.8             
      Component:  combinatorics  |    Resolution:                       
       Keywords:                 |   Work issues:                       
Report Upstream:  N/A            |     Reviewers:  Punarbasu Purkayastha
        Authors:  Nathann Cohen  |     Merged in:                       
   Dependencies:                 |      Stopgaps:                       
---------------------------------+------------------------------------------
Changes (by ncohen):

  * status:  needs_work => needs_review


Old description:

> Because I hate that :
>
> {{{
> sage: MultichooseNK(5,3)
> Combinatorial Class -- REDEFINE ME!
>
> sage: Partitions(5, min_part=0)
> /home/ncohen/.Sage/local/lib/python2.7/site-
> packages/sage/combinat/partition.py:3764: RuntimeWarning: Currently,
> setting min_part=0 produces Partition objects which violate internal
> assumptions.  Calling methods on these objects may produce errors or
> WRONG results!
>   warn("Currently, setting min_part=0 produces Partition objects which
> violate internal assumptions.  Calling methods on these objects may
> produce errors or WRONG results!", RuntimeWarning)
> Partitions of the integer 5 satisfying constraints min_part=0
>
> sage: Compositions(5, min_part=0)
> /home/ncohen/.Sage/local/lib/python2.7/site-
> packages/sage/combinat/composition.py:975: RuntimeWarning: Currently,
> setting min_part=0 produces Composition objects which violate internal
> assumptions.  Calling methods on these objects may produce errors or
> WRONG results!
>   warn("Currently, setting min_part=0 produces Composition objects which
> violate internal assumptions.  Calling methods on these objects may
> produce errors or WRONG results!", RuntimeWarning)
> Compositions of the integer 5 satisfying constraints min_part=0
> }}}
>
> From the help of unordered_tuples (in the global namespace):
>
>    Warning: Wraps GAP - hence mset must be a list of objects that have
> string
>      representations that can be interpreted by the GAP interpreter.
>      If mset consists of at all complicated Sage objects, this
>      function does *not* do what you expect. A proper function should
>      be written! (TODO!)
>
> From the help of permutations_iterator (in the global namespace, with no
> depracation warning):
>
>     Do not use this function. It will be deprecated in future version
>     of Sage and eventually removed. Use Permutations instead;
>
> help of number_of_permutations (same as above).
>
> What this ticket does :
> * It adds a deprecation warning when `min_part = 0`, in the hope that the
> feature will be made unavailable as soon as possible, and because Nicolas
> told me that I should deprecate it first (turns out that there has been a
> warning since 2009 already).
> * It calls the proper Sage object to compute things that use to be done
> with GAP
> * Some documentation improvements.
> * This ticket *does nothing* about `MultichooseNK(5,3)` because I refuse
> to touch anything that uses things like CombinatorialClass.
> * This ticket does *not* remove all the functions `number_of_*` that are
> imported in the global namespace by a `from sage.combinat.combinat import
> *` because they are almost all deprecated anyway and will be removed,
> even if we have to wait for one more year.
>
> Nathann

New description:

 Because I hate that :

 {{{
 sage: MultichooseNK(5,3)
 Combinatorial Class -- REDEFINE ME!

 sage: Partitions(5, min_part=0)
 /home/ncohen/.Sage/local/lib/python2.7/site-
 packages/sage/combinat/partition.py:3764: RuntimeWarning: Currently,
 setting min_part=0 produces Partition objects which violate internal
 assumptions.  Calling methods on these objects may produce errors or WRONG
 results!
   warn("Currently, setting min_part=0 produces Partition objects which
 violate internal assumptions.  Calling methods on these objects may
 produce errors or WRONG results!", RuntimeWarning)
 Partitions of the integer 5 satisfying constraints min_part=0

 sage: Compositions(5, min_part=0)
 /home/ncohen/.Sage/local/lib/python2.7/site-
 packages/sage/combinat/composition.py:975: RuntimeWarning: Currently,
 setting min_part=0 produces Composition objects which violate internal
 assumptions.  Calling methods on these objects may produce errors or WRONG
 results!
   warn("Currently, setting min_part=0 produces Composition objects which
 violate internal assumptions.  Calling methods on these objects may
 produce errors or WRONG results!", RuntimeWarning)
 Compositions of the integer 5 satisfying constraints min_part=0
 }}}

 From the help of unordered_tuples (in the global namespace):

    Warning: Wraps GAP - hence mset must be a list of objects that have
 string
      representations that can be interpreted by the GAP interpreter.
      If mset consists of at all complicated Sage objects, this
      function does *not* do what you expect. A proper function should
      be written! (TODO!)

 From the help of permutations_iterator (in the global namespace, with no
 depracation warning):

     Do not use this function. It will be deprecated in future version
     of Sage and eventually removed. Use Permutations instead;

 help of number_of_permutations (same as above).

 What this ticket does :
 * It adds a deprecation warning when `min_part = 0`, in the hope that the
 feature will be made unavailable as soon as possible, and because Nicolas
 told me that I should deprecate it first (turns out that there has been a
 warning since 2009 already).
 * It calls the proper Sage object to compute things that use to be done
 with GAP
 * Some documentation improvements.
 * This ticket *does nothing* about `MultichooseNK(5,3)` because I refuse
 to touch anything that uses things like CombinatorialClass.
 * This ticket does *not* remove all the functions `number_of_*` that are
 imported in the global namespace by a `from sage.combinat.combinat import
 *` because they are almost all deprecated anyway and will be removed, even
 if we have to wait for one more year.

 Nathann

 Apply:
     * [attachment:trac_14138.patch]
     * [attachment:trac_14138-doctests.patch]

--

Comment:

 Needs a review !

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14138#comment:23>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to