#13605: Partition options and cleanup partitions documentation
-----------------------------------------------+----------------------------
Reporter: tscrim | Owner: sage-combinat
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.7
Component: combinatorics | Resolution:
Keywords: partition, options, output | Work issues:
Report Upstream: N/A | Reviewers: Andew Mathas
Authors: Travis Scrimshaw | Merged in:
Dependencies: #13074 #13762 #13840 #10193 | Stopgaps:
-----------------------------------------------+----------------------------
Comment (by andrew.mathas):
Looking more at the orderings the following behaviour strikes me as being
counter intuitive and confusing:
{{{
sage: mu=Partition([5,4])
sage: Partitions(order='dominance')(mu) in Partitions(9)
True
sage: Partitions(order='dominance')(mu) < Partitions(9)(mu)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/usr/local/src/sage/sage-5.5/devel/sage-combinat/sage/combinat/<ipython
console> in <module>()
/usr/local/src/sage/sage-5.5/local/lib/python2.7/site-
packages/sage/combinat/partition.pyc in __lt__(self, other)
632 order = self.parent().order()
633 if order != other.parent().order():
--> 634 raise TypeError("orders must be the same")
635 elif order == "lex":
636 return self._list.__lt__(other._list)
TypeError: orders must be the same
}}}
If the ordering really is "part" of the elements then, above, I think that
we should have the following behaviour:
{{{
sage: Partitions(order='dominance')(mu) in Partitions(9)
False
}}}
Two other (minor) things that I don't like about the current way the
orderings are done are:
* the name "lex" and '"rev_lex" should really be "lexicographic" and
"reverse lexicographic", but accept shorthands. Having order[:3] == 'lex'
etc would solve this.
* I don't really like have to use ''Partitions(order="...")'' for some
orderings and ''reverse(Partitions(order="..."))'' for others. I think
that each of the ordering should allow a ''reverse'' modifier: so
''Partitions(order='dom')'' and ''Partitions(order='rev dom')'' should
both be OK.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13605#comment:20>
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].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.