El dt 18 de 08 del 2009 a les 11:31 -0400, en/na Manning, Jonathan va escriure: > I know they are unimplemented, but I'm working with non-pytables files > that do contain them. I'm currently trying to delete a few redundant > datasets from these files, then copy/repack to reclaim space. Using > pytables, and a script derived from ptrepack have got me very far. > > First, is there any ongoing work in this area I should be aware of? > Or, is pytables focused on fixed length data types as I've read > elsewhere and has no plans to support these (otherwise very common in > hdf5 files) variable length strings?
Perhaps implementing variable length strings as atoms for VLArray leaves would be feasible (I'll probably add a ticket on this later on). What is not planned is to implement variable length strings in Table or other Array objects. OTOH, support for variable length strings as attributes is definitely on the TODO list (and will be implemented in 2.2, most probably). > Either way, I've encountered a few issues, and have a few fixes to > suggest. > > If a dataset has variable length strings, they come up > "UnImplemented", a warning is issued, and they are ignored. Until > they are supported, this is OK. > > However, ptrepack chokes, since it queries srcNode._c_classId (at the > end of copyLeaf), and this isn't set for UnImplemented. A quick patch > setting: > UnImplemented._c_classId = "UnImplemented" > works, and allows ptrepack to run successfully. Good catch. Will fix. > If an *attribute* has a variable length string, the error is fatal > [full exception below]. I would expect it to also come up > UnImplemented. Since attributes are loaded when the node is retrieved > using _g_getChild(), I can't even walk a tree (via > n._v_children.itervalues()) that contains variable length strings as > attributes. In the same spirit as the "UnImplemented" class, I would > expect these attributes to simply come up as an UnImplemented type, so > I can walk the nodes and skip them as needed (ideally via > introspection). This is a bug. Can you try with the next patch? Index: tables/utilsExtension.pyx =================================================================== --- tables/utilsExtension.pyx (revision 4228) +++ tables/utilsExtension.pyx (working copy) @@ -670,7 +670,10 @@ stype = "c%s" % (itemsize) elif class_id == H5T_STRING: if H5Tis_variable_str(type_id): - raise TypeError("variable length strings are not supported yet") + if issue_error: + raise TypeError("variable length strings are not supported yet") + else: + return None, None stype = "S%s" % (itemsize) elif class_id == H5T_TIME: stype = "t%s" % (itemsize) HTH, Francesc ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Pytables-users mailing list Pytables-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pytables-users