Hi Uwe,
Sorry, I wrote this when I was away from my computer and so I couldn't test
it.
Our documentation is clearly wrong then. However, what you *can* do is
take
the dtype from a known VideoNode table and then compare using this.
known_dtype = f.root.path_to_a_video_node.dtype
bar = filter(x.dtype == known_dtype for x in f.walkNodes('/', 'Table'))
Note that in your file your file you could create an empty table with the
VideoNode
description at a specific location just so that you can read out this dtype.
Be Well
Anthony
On Mon, May 21, 2012 at 6:20 AM, Uwe Mayer <uwe.ma...@dfki.de> wrote:
> Hi Anthony,
>
> On 05/19/2012 08:12 PM, Anthony Scopatz wrote:
> > Hello Uwe,
> >
> > Why don't you try something like:
> >
> > bar = filter(x.description == VideoNode for x in f.walkNodes('/',
> 'Table'))
> >
> > or
> >
> > bar = filter(x.dtype == VideoNode._v_dtype for x in f.walkNodes('/',
> > 'Table'))
> >
> > to compare the dtype / description directly?
>
> correction on my behalf, that would be exactly what I needed, but:
>
> - x.description compares false to a (correct) subclass of
> tables.IsDescription
>
> - a subclass of tables.IsDescription has no property _v_dtype to compare
> to x.dtype (from your example above)
>
>
> Any other ideas?
>
> Thanks in advance,
> Uwe
>
>
> > On May 18, 2012 8:00 AM, "Uwe Mayer" <uwe.ma...@dfki.de
> > <mailto:uwe.ma...@dfki.de>> wrote:
> >
> > Hi,
> >
> > I have several leaf nodes of the same table dtype:
> >
> > class VideoNode(tables.IsDescription):
> > ...
> >
> > Not all tables in the hdf5 file are of the same type, however. How
> > do I iterate
> > over all leafes which are tables of the above class, while ignoring
> > tables with
> > different signatures?
> >
> > i.e. I'd like to write something like:
> > <code>
> > f = tables.openFile(...)
> > foo = f.walkNodes('/', classname='VideoNode')
> > </code>
> > which does not work because only the class name is "Table"...
> >
> > or
> > <code>
> > bar = filter(isinstance(x, VideoNode) for x in f.walkNodes('/',
> > 'Table')))
> > </code>
> >
> > which does not work, because x is never an instance of VideoNode.
> >
> > Any ideas?
> >
> > Thanks in advance
> > Uwe
> >
> >
> >
> ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond.
> > Discussions
> > will include endpoint security, mobile security and the latest in
> > malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > Pytables-users mailing list
> > Pytables-users@lists.sourceforge.net
> > <mailto:Pytables-users@lists.sourceforge.net>
> > https://lists.sourceforge.net/lists/listinfo/pytables-users
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >
> >
> >
> > _______________________________________________
> > Pytables-users mailing list
> > Pytables-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/pytables-users
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Pytables-users mailing list
> Pytables-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pytables-users
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users