#18223: cartesian products with orders
-------------------------------------+-------------------------------------
Reporter: dkrenn | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.7
Component: categories | Resolution:
Keywords: sd67 | Merged in:
Authors: Daniel Krenn | Reviewers: Benjamin Hackl
Report Upstream: N/A | Work issues:
Branch: u/behackl/cat | Commit:
/cartesian-product-posets | 0690e716b925505dc34b77338af0da8f35fc53a4
Dependencies: #18586 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
5. Instead of `order=components` I would use `order=product` which is the
standard name (see [https://en.wikipedia.org/wiki/Product_order
wikipedia]). And put it first in your list in view of comment 4.
6. Why
{{{
super(CartesianProductPosets, self).__init__(sets, category, **kwargs)
from sage.categories.posets import Posets
self._refine_category_(Posets())
}}}
instead of
{{{
category = category.join(Posets())
CartesianProduct.__init__(sets, category, **kwargs)
}}}
I guess that the refine category operation is highly non trivial
(perhaps even sloppy).
7. (from your doctest) This is ugly
{{{
sage: QQ.CartesianProduct =
sage.sets.cartesian_product.CartesianProductPosets
}}}
Is this the way we are supposed to use to construct cartesian product of
posets!?
8. Why not implementing `_richcmp_` (see #18305)? You would end up with
less code.
9. It is always (should always be) faster to use `x <= y` instead of
`x.__le__(y)`. You avoid a lookup.
--
Ticket URL: <http://trac.sagemath.org/ticket/18223#comment:19>
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.