#17053: Add function for direct sum of posets
---------------------------------+-----------------------------
Reporter: jmantysalo | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-wishlist
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------+-----------------------------
Comment (by ncohen):
It could even be
{{{
def direct_sum(self, other, labels='pairs'):
if not hasattr(other, 'hasse_diagram'):
raise ValueError('The input is not a finite poset.')
return
Poset(self.hasse_diagram().disjoint_union(other.hasse_diagram(),
labels=labels))
}}}
Of course right now `Graph.disjoint_union` has no `labels` argument, but
we have something called `sage.misc.decorators.rename_keyword` precisely
for this reason (to change the name of an argument and handle the
deprecation warnings). And then the graph function would understand this
labels argument as it is clearer anyway.
The thing is that checking the value of the keyword should be done only
once. Preferably in the graph method.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/17053#comment:9>
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/d/optout.