Discussion:
iter_nodes() File method vs _v_leaves Group attribute
(too old to reply)
Ken Walker
2018-09-24 21:58:28 UTC
Permalink
I'm working with a HDF5 file format with Groups that may have a variety of
2d Table dataset names, and may have Groups. I've been using iter_nodes()
to identify the Tables found in a particular model, then process based on
what I find....
Recently I stumbled into the _v_leaves Group attribute, which simplifies
the process (no need to figure out if a Node is a Leaf or Group!).
So, no I'm wondering...should I be using the _v_leaves Group attribute to
get my Datasets, or iter_nodes() ??
Any insights from more experienced users?
Thanks in advance,
-Ken
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Francesc Alted
2018-09-26 11:23:20 UTC
Permalink
Hi Ken,

Both approaches are equally valid, but the advantage of the iter_nodes()
approach is that you can specify the class ('Table', 'Array', 'Group') of
the nodes that are returned. Performance wise, both ways would be rather
similar, I'd say,

Francesc
Post by Ken Walker
I'm working with a HDF5 file format with Groups that may have a variety of
2d Table dataset names, and may have Groups. I've been using iter_nodes()
to identify the Tables found in a particular model, then process based on
what I find....
Recently I stumbled into the _v_leaves Group attribute, which simplifies
the process (no need to figure out if a Node is a Leaf or Group!).
So, no I'm wondering...should I be using the _v_leaves Group attribute to
get my Datasets, or iter_nodes() ??
Any insights from more experienced users?
Thanks in advance,
-Ken
--
You received this message because you are subscribed to the Google Groups
"pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Francesc Alted
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ken Walker
2018-09-26 13:48:34 UTC
Permalink
Hi Francesc,
Thanks for the insights. You know that Python saying ("There should be
one-- and preferably only one --obvious way to do it").
I am "somewhat new" to HDF5 and PyTables. So, many of my questions are
intended to establish the one obvious way to do things for others in the
organization (aka "best practices").
Thanks!!
-Ken
Post by Francesc Alted
Hi Ken,
Both approaches are equally valid, but the advantage of the iter_nodes()
approach is that you can specify the class ('Table', 'Array', 'Group') of
the nodes that are returned. Performance wise, both ways would be rather
similar, I'd say,
Francesc
Post by Ken Walker
I'm working with a HDF5 file format with Groups that may have a variety
of 2d Table dataset names, and may have Groups. I've been using
iter_nodes() to identify the Tables found in a particular model, then
process based on what I find....
Recently I stumbled into the _v_leaves Group attribute, which simplifies
the process (no need to figure out if a Node is a Leaf or Group!).
So, no I'm wondering...should I be using the _v_leaves Group attribute to
get my Datasets, or iter_nodes() ??
Any insights from more experienced users?
Thanks in advance,
-Ken
--
You received this message because you are subscribed to the Google Groups
"pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
For more options, visit https://groups.google.com/d/optout.
--
Francesc Alted
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...