The current behavior for CompositeKind data is
|
# Write generic CompositeKind as a struct |
|
function m_write(mfile::MatlabHDF5File, parent::HDF5Parent, name::String, s) |
|
if isbits(s) |
|
error("This is the write function for CompositeKind, but the input doesn't fit") |
|
end |
|
T = typeof(s) |
|
m_write(mfile, parent, name, check_struct_keys([string(x) for x in fieldnames(T)]), [getfield(s, x) for x in fieldnames(T)]) |
|
end |
however, there are issues with the isbits(s) test, reported in #162,#143 or with simple user types such as
struct MyType
field1::Int64
field2::Int64
end
While these types are clearly isbitstypes, I do not see a reason to not allow their conversion the equivalent matlab struct.
Given
|
m_write(mfile, parent, name, check_struct_keys([string(x) for x in fieldnames(T)]), [getfield(s, x) for x in fieldnames(T)]) |
The requirement seems more to be that
fieldcount(T) > 0, regardless of the actual bits type.
Can someone confirm this ?
The current behavior for
CompositeKinddata isMAT.jl/src/MAT_HDF5.jl
Lines 529 to 536 in 355bd1a
however, there are issues with the
isbits(s)test, reported in #162,#143 or with simple user types such asWhile these types are clearly
isbitstypes, I do not see a reason to not allow their conversion the equivalent matlab struct.Given
MAT.jl/src/MAT_HDF5.jl
Line 535 in 355bd1a
The requirement seems more to be that
fieldcount(T) > 0, regardless of the actual bits type.Can someone confirm this ?