Since there is already support for reading/writing compound types, I wanted to try adding support for Tuples as well, since sometimes saving tuple data is convenient, or compound types have tuple data (e.g. SArray). This pr writes tuples to compound types with member names corresponding to the indices of each element, i.e. var"1", var"2", var"3",.... I understand that there is no native HDF5 type corresponding to a tuple, however this pr is non-breaking and since tuples will be read back as named tuples, which inherit the majority of behavior from tuples, this only provides additional features. Please advise.
I also made the following changes:
allow dset[i] = e for e a compound type by loosening method signatures
add a method for datatype(::Type{T}) so that create_dataset(parent, path, T, dataspace) works for compound types T
I also prepared a follow-up pr showing that we can save StaticArrays as compound types (https://github.com/lxvm/HDF5.jl/tree/pr_sarray), although one method would change in a breaking way.
Since there is already support for reading/writing compound types, I wanted to try adding support for
Tuple
s as well, since sometimes saving tuple data is convenient, or compound types have tuple data (e.g.SArray
). This pr writes tuples to compound types with member names corresponding to the indices of each element, i.e.var"1", var"2", var"3",...
. I understand that there is no native HDF5 type corresponding to a tuple, however this pr is non-breaking and since tuples will be read back as named tuples, which inherit the majority of behavior from tuples, this only provides additional features. Please advise.I also made the following changes:
dset[i] = e
fore
a compound type by loosening method signaturesdatatype(::Type{T})
so thatcreate_dataset(parent, path, T, dataspace)
works for compound typesT
I also prepared a follow-up pr showing that we can save StaticArrays as compound types (https://github.com/lxvm/HDF5.jl/tree/pr_sarray), although one method would change in a breaking way.