From: Anthony S. <sc...@gm...> - 2012-05-19 18:13:03
|
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? Be Well Anthony On May 18, 2012 8:00 AM, "Uwe Mayer" <uwe...@df...> 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 > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users > |