Closed jreadey closed 9 years ago
What do you mean? Are you talking about an issue in the JSON rendering or the HDF5 generation, or what?
When converting JSON containing a attribute or dataset with a string type, the nullpad attribute doesn't make it to the HDF5 file - the strpad value is always show up as nullpad. E.g. this json:
"datasets": {
"b69e2e99-cd15-11e4-bcb2-3c15c2da029e": {
"alias": [
"/DS1"
],
"attributes": [
{
"name": "A1",
"shape": {
"class": "H5S_SIMPLE",
"dims": [
4
]
},
"type": {
"charSet": "H5T_CSET_ASCII",
"class": "H5T_STRING",
"length": 5,
"order": "H5T_ORDER_NONE",
"strPad": "H5T_STR_NULLTERM"
},
"value": [
"HELLO",
"Hi",
"HELLO ",
"Hihihihi"
]
}
],
"shape": {
"class": "H5S_NULL"
},
"type": {
"base": "H5T_STD_I32LE",
"class": "H5T_INTEGER"
},
"value": null
}
},
"groups": {
"b69d219c-cd15-11e4-a723-3c15c2da029e": {
"alias": [
"/"
],
"links": [
{
"class": "H5L_TYPE_HARD",
"collection": "datasets",
"id": "b69e2e99-cd15-11e4-bcb2-3c15c2da029e",
"title": "DS1"
}
]
}
},
"root": "b69d219c-cd15-11e4-a723-3c15c2da029e"
}
Gets converted to this HDF5:
HDF5 "out/fixed_string_attr.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_STD_I32LE
DATASPACE NULL
DATA {
}
ATTRIBUTE "A1" {
DATATYPE H5T_STRING {
STRSIZE 5;
STRPAD H5T_STR_NULLPAD;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
DATA {
(0): "HELLO", "Hi\000\000\000", "HELLO", "Hihih"
}
}
}
}
}
This is fixed for top-level types (but not strings that are part of a compound type).
All strings are saved as NULLPAD regardless of String Pad value.