I am attempting to concatenate a bunch of h5 datafiles into a single larger file to feed into my program. I am doing this by using h5py.VirtualLayout to However, I am struggling to maintain the format in the merged file. This is because I have some datasets in the file which are bools. Using h5dump, I can see that the format is:
DATASET "mask" { DATATYPE H5T_ENUM { H5T_STD_I8LE; "FALSE" 0; "TRUE" 1; }
In the original data generation, they are defined as
mask_set = source_group.create_dataset("mask", data=np.array(mask_list, dtype='bool'))
But after concatenation, they end up as:
DATASET "mask" { DATATYPE H5T_IEEE_F64LE
or similar, depending on what I pass as dtype to h5py.VirtualLayout. The above is using dtype=None, but I continue to have problems specifying int, np.int, etc.
If I try to pass dtype defined with a line like:
dtype = 'bool'
or
dtype = h5py.enum_dtype({"FALSE":0, "TRUE":1}, basetype=np.int8)
I get an error:
ValueError: Unable to create dataset (no appropriate function for conversion path)
So my question is; how do preserve the enum type when using VirtualLayout?