#18223: cartesian products with orders
-------------------------------------+-------------------------------------
Reporter: dkrenn | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.7
Component: categories | Resolution:
Keywords: sd67 | Merged in:
Authors: Daniel Krenn | Reviewers: Benjamin Hackl,
Report Upstream: N/A | Vincent Delecroix
Branch: u/dkrenn/cat | Work issues:
/cartesian-product-posets | Commit:
Dependencies: #18586 | 8f9a61942e14254ec028924bccf918774fb57cf6
| Stopgaps:
-------------------------------------+-------------------------------------
Changes (by dkrenn):
* status: needs_work => needs_review
* commit: 6ca3e5fd32c7fc5398ece1876ce5981f27663a60 =>
8f9a61942e14254ec028924bccf918774fb57cf6
Comment:
Replying to [comment:43 vdelecroix]:
> 16. The name `CartesianProductPosets` looks weird. I would rather go for
`CartesianProductPoset` (no `s`) or `PosetsCartesianProduct`. As it is
currently it looks like ''the set of posets that are made from cartesian
products''.
Ok (I don't have an opinion on this); changed to `CartesianProductPoset`.
> 17. You should remove your name from `sage/sets/cartesian_product.py`. I
have nothing agaist authorship but as it is, it looks like spam ;-)
Ooops...forgotten to remove it (when moving to the code to
`combinat.posets`). Thanks; removed.
> 18. There is no example testing that the coercion can get involved in
comparisons. Either it is worth it and it needs a use case or it can be
removed.
I've added a doctest. This test can and will be rewritten once #18182 is
merged.
> 19. This is not nice
> {{{
> + CartesianProductPosets = LazyImport(
> + 'sage.combinat.posets.cartesian_product',
'CartesianProductPosets')
> + CartesianProduct = CartesianProductPosets
> }}}
> because
> {{{
> sage: E = Posets().example()
> sage: E.Car<tab>
> E.CartesianProduct E.CartesianProductPosets
> }}}
> which actually point toward the exact same thing.
I completly agree.
> Please change for
> {{{
> + CartesianProduct = LazyImport(
> + 'sage.combinat.posets.cartesian_product',
'CartesianProductPosets')
> }}}
I wasn't aware that this works, but it is clear that it works :) Changed.
> 20. Most methods of finite posets are actually not available in this
class... this is very annoying (but I do not see what can be done at the
level of this ticket).
True; I think this should be fixed by using the `Posets`-category, but
definitely not on this ticket.
> 21. Are you aware that
> {{{
> sage: C = cartesian_product([ZZ, ZZ], extra_category=Posets())
> sage: from sage.combinat.posets.cartesian_product import
CartesianProductPosets
> sage: isinstance(C, CartesianProductPosets)
> False
> }}}
> and indeed
> {{{
> sage: TestSuite(C).run()
> Failure in _test_not_implemented_methods:
> ...
> AssertionError: Not implemented method: le
> ------------------------------------------------------------
> The following tests failed: _test_not_implemented_methods
> }}}
Yes, I am aware of. Adding an extra category only makes sense if the
underlying object is a poset (thus has `le`). Since `ZZ` is not a poset
(see #19269), the cartesian product is not a poset (and has no `le`) and
therefore is not an instance of `CartesianProductPoset`. Thus, the failure
of the test suite is correct.
FYI: The class used for the cartesian product is determined by its first
factor (and not by the category).
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=70aa9c4fa3c8711fb7dc4aea446d4624d2a27803
70aa9c4]||{{{rename CartesianProductPosets to CartesianProductPoset}}}||
||[http://git.sagemath.org/sage.git/commit/?id=f21990d0b55e665aed89b8aef0f862eef59d6368
f21990d]||{{{code-simplify CartesianProduct assignment}}}||
||[http://git.sagemath.org/sage.git/commit/?id=8f9a61942e14254ec028924bccf918774fb57cf6
8f9a619]||{{{add a doctest dealing with coercion while comparing}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/18223#comment:45>
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.