Thank you all, now it is much more clear.
On Wed, Nov 28, 2012 at 12:30 AM, Anthony Scopatz <[email protected]> wrote:
>
> On Wed, Nov 28, 2012 at 1:03 AM, Antonio Valentino
> <[email protected]> wrote:
>>
>> Hi Anthony, hi dashesy,
>>
>>
>> Il giorno 28/nov/2012, alle ore 00:57, Anthony Scopatz <[email protected]>
>> ha scritto:
>>
>> > This [1] seems to indicate that this kind of thing should be supported
>> > via numpy structured arrays. However, I bet that this data set did not
>> > start out as a numpy structured array. This might explain the problem if
>> > the flavor is wrong. I would think that a fix should be relatively easy.
>> >
>> > Be Well
>> > Anthony
>> >
>> > 1.
>> > http://pytables.github.com/usersguide/libref/declarative_classes.html?highlight=attr#the-attributeset-class
>> >
>>
>> I'm not sure that PyTables is able to handle variable length strings in
>> compound data types at the moment.
>
>
> Oops, I didn't notice that... Antonio is right, the variable length part of
> this is probably your issue.
>
>>
>>
>> >
>> > On Tue, Nov 27, 2012 at 5:17 PM, dashesy <[email protected]> wrote:
>> > I have a file that has attributes with nested compound type, when
>> > reading it with PyTables 2.4.0 I get this error:
>> >
>> > C:\Python27\lib\site-packages\tables\attributeset.py:293:
>> > DataTypeWarning: Unsupported type for attribute 'BmiRoot' in node '/'.
>> > Offending HDF5 class: 6
>> > value = self._g_getAttr(self._v_node, name)
>> > C:\Python27\lib\site-packages\tables\attributeset.py:293:
>> > DataTypeWarning: Unsupported type for attribute 'BmiChanExt' in node
>> > 'channel00001'. Offending HDF5 class: 6
>> > value = self._g_getAttr(self._v_node, name)
>> >
>>
>> Yes, it is not clear
>>
>> > Hard to say what exactly happens, just wanted to know if this is not
>> > already fixed in newer versions I will be more than happy to work on
>> > it, any pointers as to where to look is appreciated.
>> >
>>
>> I don't thing that there are changes that can impact on this issue.
>> Anyway you can give a try to the development branch [1]
>>
>> Any help is very appreciated
>>
>> [1] https://github.com/PyTables/PyTables
>>
I found the issues 48 and 54 on GitHub and 122 on Sourceforge refer to
the same problem.
It seems there is a potential solution using VLTables which I will
look into first,
I have created my vl string type using:
hid_t tid_attr_vl_str = H5Tcopy(H5T_C_S1);
ret = H5Tset_size(tid_attr_vl_str, H5T_VARIABLE);
I will first look at this (and add a test for in /tables/tests), but
reading the trac it seems there might be other form of vl strings in
the wild.
I appreciate if you have any comments or advice
>>
>> > Here is the (partial) dump of the file (for brevity I deleted
>> > non-related data parts but can provide the full file if needed):
>> >
>> > HDF5 "pause5-10-5.ns2.h5" {
>> > GROUP "/" {
>> > ATTRIBUTE "BmiRoot" {
>> > DATATYPE "/BmiRootAttr_t"
>> > DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
>> > DATA {
>> > (0): {
>> > 1,
>> > 0,
>> > 0,
>> > 1,
>> > "2008-12-02 22:57:02.251000",
>> > "1 kS/s",
>> > ""
>> > }
>> > }
>> > }
>> > DATATYPE "BmiRootAttr_t" H5T_COMPOUND {
>> > H5T_STD_U32LE "MajorVersion";
>> > H5T_STD_U32LE "MinorVersion";
>> > H5T_STD_U32LE "Flags";
>> > H5T_STD_U32LE "GroupCount";
>> > H5T_STRING {
>> > STRSIZE H5T_VARIABLE;
>> > STRPAD H5T_STR_NULLTERM;
>> > CSET H5T_CSET_ASCII;
>> > CTYPE H5T_C_S1;
>> > } "Date";
>> > H5T_STRING {
>> > STRSIZE H5T_VARIABLE;
>> > STRPAD H5T_STR_NULLTERM;
>> > CSET H5T_CSET_ASCII;
>> > CTYPE H5T_C_S1;
>> > } "Application";
>> > H5T_STRING {
>> > STRSIZE H5T_VARIABLE;
>> > STRPAD H5T_STR_NULLTERM;
>> > CSET H5T_CSET_ASCII;
>> > CTYPE H5T_C_S1;
>> > } "Comment";
>> > }
>> > GROUP "channel" {
>> > DATATYPE "BmiChanAttr_t" H5T_COMPOUND {
>> > H5T_STD_U16LE "ID";
>> > H5T_IEEE_F32LE "Clock";
>> > H5T_IEEE_F32LE "SampleRate";
>> > H5T_STD_U8LE "SampleBits";
>> > }
>> > DATATYPE "BmiChanExt2Attr_t" H5T_COMPOUND {
>> > H5T_STD_I32LE "DigitalMin";
>> > H5T_STD_I32LE "DigitalMax";
>> > H5T_STD_I32LE "AnalogMin";
>> > H5T_STD_I32LE "AnalogMax";
>> > H5T_STRING {
>> > STRSIZE 16;
>> > STRPAD H5T_STR_NULLTERM;
>> > CSET H5T_CSET_ASCII;
>> > CTYPE H5T_C_S1;
>> > } "AnalogUnit";
>> > }
>> > DATATYPE "BmiChanExtAttr_t" H5T_COMPOUND {
>> > H5T_IEEE_F64LE "NanoVoltsPerLSB";
>> > H5T_COMPOUND {
>> > H5T_STD_U32LE "HighPassFreq";
>> > H5T_STD_U32LE "HighPassOrder";
>> > H5T_STD_U16LE "HighPassType";
>> > H5T_STD_U32LE "LowPassFreq";
>> > H5T_STD_U32LE "LowPassOrder";
>> > H5T_STD_U16LE "LowPassType";
>> > } "Filter";
>> > H5T_STD_U8LE "PhysicalConnector";
>> > H5T_STD_U8LE "ConnectorPin";
>> > H5T_STRING {
>> > STRSIZE H5T_VARIABLE;
>> > STRPAD H5T_STR_NULLTERM;
>> > CSET H5T_CSET_ASCII;
>> > CTYPE H5T_C_S1;
>> > } "Label";
>> > }
>> > DATATYPE "BmiChanFiltAttr_t" H5T_COMPOUND {
>> > H5T_STD_U32LE "HighPassFreq";
>> > H5T_STD_U32LE "HighPassOrder";
>> > H5T_STD_U16LE "HighPassType";
>> > H5T_STD_U32LE "LowPassFreq";
>> > H5T_STD_U32LE "LowPassOrder";
>> > H5T_STD_U16LE "LowPassType";
>> > }
>> > GROUP "channel00001" {
>> > ATTRIBUTE "BmiChan" {
>> > DATATYPE "/channel/BmiChanAttr_t"
>> > DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
>> > DATA {
>> > (0): {
>> > 1,
>> > 30000,
>> > 1000,
>> > 16
>> > }
>> > }
>> > }
>> > ATTRIBUTE "BmiChanExt" {
>> > DATATYPE "/channel/BmiChanExtAttr_t"
>> > DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
>> > DATA {
>> > (0): {
>> > 1000,
>> > {
>> > 750000,
>> > 4,
>> > 1,
>> > 7500,
>> > 3,
>> > 1
>> > },
>> > 1,
>> > 1,
>> > "elec1"
>> > }
>> > }
>> > }
>> > ATTRIBUTE "BmiChanExt2" {
>> > DATATYPE "/channel/BmiChanExt2Attr_t"
>> > DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
>> > DATA {
>> > (0): {
>> > -8191,
>> > 8191,
>> > -8191,
>> > 8191,
>> > "uV"
>> > }
>> > }
>> > }
>> > DATASET "continuous_set" {
>> > DATATYPE H5T_STD_I16LE
>> > DATASPACE SIMPLE { ( 631 ) / ( H5S_UNLIMITED ) }
>> > DATA {...
>> > }
>> > }
>> > }
>> > }
>> > }
>> > }
>>
>>
>> --
>> Antonio Valentino
>>
>>
>>
dashesy
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users