#14772: Remove CombinatorialClass from Permutations
------------------------------------+------------------------------------
Reporter: tscrim | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: days49 | Merged in:
Authors: Travis Scrimshaw | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Dependencies: #8386 #14519 #14808
Stopgaps: |
------------------------------------+------------------------------------
Comment (by tscrim):
Replying to [comment:44 darij]:
> Great!
>
> I'll look into the multisets issue, but as for now here is a fix for
another bug:
> {{{
> sage: Permutations(descents=[1,3,4]).list()
> }}}
> gave an error. It turns out that, lacking an n-value in the input, the
code would automatically set n to be the maximum entry of the list {{{[1,
3, 4]}}} plus 1 (btw, that causes another bug when the list is empty;
fixed as well), but whoever wrote that must have missed the fact that the
positions start with 0 (so a presence of 3 in the list really means that
the permutations will have a descent at 4, i. e., their value at 4 will be
larger than their value at 5), so the "correct" n would be the maximum
entry of the list {{{[1, 3, 4]}}} plus 2.
Mmmmm...zero based indexing errors. I completely forgot to fix the
containment issue when folding in the review patch. Sorry.
> I think this is a completely stupid convention to make, and the syntax
(giving the set of descents as a list without the n, having Sage
automatically choose the n) should not be supported (no doctests in
permutation.py use this syntax). Note that it only allows constructing
permutations where the penultimate position is a descent; all the others
require the long syntax with the n given! Also, it is misleading, because
{{{descents=[1,3,4]}}} sounds like it should give the permutations with
descent composition {{{[1,3,4]}}}, but the role of {{{[1,3,4]}}} here is
absolutely not that of a composition.
I wouldn't think it would be able to handle the descents composition (even
without considering the doc which explicitly states this).
>
> Would you agree with axing the syntax?
I'm not opposed to deprecating that form of input (it's not syntax
strictly speaking), so if `descents` is passed in and no `n`, then it
raises a deprecation warning.
I'll be going to sleep now (I'm in India in case you're curious), so you
won't get a reply for at least 8 hours from me. Although at this rate I
think there won't be a single bug left anywhere near permutations. XP
Thanks,[[BR]]
Travis
--
Ticket URL: <http://trac.sagemath.org/ticket/14772#comment:46>
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.
For more options, visit https://groups.google.com/groups/opt_out.