#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:
Authors: | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Comment (by ppurka):
Hello Nathann, the patch seems good and those files in `sage.combinat`
need a lot of cleanup. They seem abandoned for years :(. I also have some
other specific comments:
1. I think the following should be changed to
{{{
47 The following functions will soon be deprecated.
}}}
{{{
The following functions are deprecated and will soon be removed.
}}}
2. The cardinality should be a method
{{{
2027 deprecation(14138, 'Use Combinations(mset,k).cardinality
instead.')
}}}
{{{
deprecation(14138, 'Use Combinations(mset,k).cardinality() instead.')
}}}
3. What is this deprecated in favor of? I think it should be mentioned
that the `min_part=0` will raise an error in the future.
{{{
3763 from sage.misc.superseded import deprecation
3764 deprecation(14138,"Currently, setting
min_part=0 produces "+
3765 "Partition objects which violate
internal "+
3766 "assumptions. Calling methods on
these objects "+
3767 "may produce errors or WRONG
results!")
}}}
4. The following `..note::` should be deleted now since `Combinations` can
handle any Sage object
{{{
def number_of_combinations(mset,k):
"""
Returns the size of combinations(mset,k). IMPLEMENTATION: Wraps
GAP's NrCombinations.
.. note::
``mset`` must be a list of integers or strings (i.e., this is
very restricted).
}}}
5. The last sentence should be removed here
{{{
Returns the size of arrangements(mset,k). Wraps GAP's
NrArrangements.
}}}
6. In the function `def number_of_permutations(mset):` I think you can
replace all of its code with `Permutations(mset).cardinality()`?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14138#comment:7>
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.