[Yt-dev] EnzoFOF merger tree

Matthew Turk matthewturk at gmail.com
Fri Jan 14 14:28:28 PST 2011


Hi Stephen,

We have several ways of representing hierarchical data in yt, most of
which follow this basic concept:

Object [with some supplemental data]
   Children [list of Objects]

I don't think we want to standardize on our data objects being the
data objects from pydot -- I don't think we want "Clump" for instance
or "Halo" to inherit from pydot.  I just thought we could figure out a
way to write out dotfiles without using a big package... My original
idea was to create a function something like:

def write_hierarchical_dotfile(base_nodes, child_node_name,
supplemental_data_function_name, parent = None, f = ""):
    if isinstance(f, types.StringTypes): f = open(f, "w")
    for n in base_nodes:
        sdata = getattr(n, supplemental_data_function_name)()
        new_node = write_node(n, sdata):
        if parent is not None: connect_node(parent, new_node)
        write_hierarchical_dotfile(getattr(n, child_node_name),
supplemental_data_function_name, new_node, f)

So we would still be writing dotfiles, but we could keep the
nomenclature children, etc etc.  Obviously this particular function
would not work for multiple parents, but as an example it's closer to
what I was thinking.  My recollection is that the dot file format is
very straightforward and simple, and we could use something like this.
 Does this make sense?  Am I missing a big benefit that pydot
provides?

-Matt
On Fri, Jan 14, 2011 at 5:16 PM, Stephen Skory <stephenskory at yahoo.com> wrote:
> All,
>
>> Sorry, I didn't mean to output pngs directly -- I just meant, a single
>> place we could write hierarchical datasets to dot format.  There's a
>> lot of research, time, development and wheels in graphviz that we
>> don't need to reinvent.
>>
>> As for a new package, I wonder if maybe that decision would benefit
>> from a cost/benefit analysis: how much of any given graphviz wrapper
>> would we use?
>
> I think that if we have a unified way to write hierarchical data to dot files, this would require a unified way of representing hierarchical data. As such, something like pydot provides this (not that there could be something better out there). So, in this regard, a python graphviz abstraction is useful. Otherwise, we're writing our own. Thoughts?
>
>
>
>  Stephen Skory
> stephenskory at yahoo.com
> http://stephenskory.com/
> 510.621.3687 (google voice)
> _______________________________________________
> Yt-dev mailing list
> Yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>



More information about the yt-dev mailing list