Hi Jori,
when I want to iterate through posets, I do this:
sage: P3 = Posets(3); P3
Posets containing 3 vertices
sage: list(P3)
[Finite poset containing 3 elements,
Finite poset containing 3 elements,
Finite poset containing 3 elements,
Finite poset containing 3 elements,
Finite poset containing 3 elements]
The ``Posets`` function is in sage.combinat.posets.poset_example and when
given a number, it returns an instance of ``FinitePosets_n`` in
sage.combinat.posets.posets. I think for now, we only have the iteration up
to isomorphism.
>From a user point of view, it would seem natural to have something like
sage: Posets(3, ... some options ...)
Posets containing 3 vertices with ... some options ...
which could indeed return a new class ``FinitePosets_n_with_properties`` in
the model of ``FinitePosets_n`` or even just allow those properties on
``FinitePosets_n`` (not sure which option is best).
Best,
Viviane
2015-06-14 9:40 GMT-05:00 Nathann Cohen :
> Would this be good interface:
>>
>> Posets_iterator(n, properties=None, width=None, height=None)
>>
>
> Do you have a specific reason for creating a class Posets_iterator? Or
> would a simple function do the job?
>
> Whatever you chose, it should probably be made available as an element of
> posets.. For graphs, you can do "list(graphs(6))", but you may want to
> not copy this kind of behaviour. It's up to you. You could also have
> posets.posets_iterator() or posets.posets_all() or posets.posets(),
> whichever you prefer (or others I did not think of).
>
> Then, you have the problem of the "Posets" object, exported in the global
> namespace. Right now, this thing is the "category of Posets". So if you
> want something like the following to work, you will have to mess with this
> category (or replace it by another object)
>
> sage: for p in Posets(max_width=3,max_height=4,num_points=90):
> :
>
> Of course, its __iter__ method would be your iterator.
>
> Nathann
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.