On Tue, Mar 22, 2011 at 07:09:09AM -0700, Anne Schilling wrote:
> Impressive, your work on posets!

:-)

Kudos also go to Christian and Frédéric!

Oh, and I should mention that if the facade option was so far
straightforward to implement, that's because Franco's original code
was well written and encapsulated.

> >- Currently P.hasse_diagram() returns a graph G whose nodes are the
> >   elements of P (wrapped as elements of P; so one needs to do
> >   x.element to actually get the original element). This graph is still
> >   in the HasseDiagram class. The issue is that HasseDiagram's expect
> >   their vertices to be 0,1,...,n-1, so most of the extra methods just
> >   break.
> >
> >   Option 1: P.hasse_diagram() returns a plain digraph
> >
> >   Option 2: P.hasse_diagram() returns the internal HasseDiagram, with
> >             vertices labelled 0,1,...,n
> >
> >   What do you prefer? I personally vote for 2; as a user, that's what
> >   I would expect.
> I would probably prefer 2 as well.

Arr, sorry, I actually meant 1. For my penance a concrete example to
think about::

        sage: P = Poset((Subsets(2), attrcall("issubset")))

Option (1):

        sage: P.hasse_diagram().edges()
        [({}, {2}, None), ({}, {1}, None), ({2}, {1, 2}, None), ({1}, {1, 2}, 
None)]
        sage: P.hasse_diagram().__class__
        <class 'sage.graphs.digraph.DiGraph'>

Option (2):

        sage: P.hasse_diagram().edges()
        [(0, 1, None), (0, 2, None), (1, 3, None), (2, 3, None)]
        sage: P.hasse_diagram().__class__
        <class 'sage.combinat.posets.hasse_diagram.HasseDiagram'>


> >   Another question is whether we want the vertices P.hasse_diagram()
> >   to be wrapped or not. And if we are unhappy with the situation, is
> >   still time to change this?
> 
> If it is possible not to wrap them, I think this would be good.
> At least I ran into some problems when playing with posets in the past.

Yup. Please try out the facade option. I'd love to have feedback on it!

Cheers,
                                Nicolas
--
Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to