From: Francesc A. <fa...@ca...> - 2005-05-31 15:58:25
|
A Dimarts 31 Maig 2005 14:30, phi...@ho... va escriure: > Hi list, > > I'm browsing an hdf5 file using pytables 1.0 with python 2.3 and fill a > gtk treeview. > I use a list composed with dictionaries to store the name and the type > of node in the hdf5 file. > Here is the method i use: <stripped...> > I didn't find a better way to do it. The problems are: > - i use lots of for loop -that's a memory waste- Not necessarily, but I accept that is more CPU intensive. > - i use three differents functions to get the name of node > (group._v_name, array.hdf5name, Table.hdf5name). Is it appropriate. Well, this can be somewhat improved. hdf5name is the real name of the dataset on disk while name (or _v_name) are the names in PyTables space (memory). You can use _v_name for all nodes for simplicity. > - When i see the result, a table which is in a group is displayed > also in the root node '/'. I don't know why. Can you provide a simple example that shows this behaviour? > Is there a better way to do this? What about: for node in h5file: components_list.append({'name':node._v_name, 'type':node._v_attrs.CLASS= }) Cheers, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |