Skip to content

Instantly share code, notes, and snippets.

@simonster
Last active August 29, 2015 14:05
Show Gist options
  • Save simonster/50d282a533a76eaebbb3 to your computer and use it in GitHub Desktop.
Save simonster/50d282a533a76eaebbb3 to your computer and use it in GitHub Desktop.
jld immutables
HDF5 "test.jld" {
GROUP "/" {
DATASET "ComplexImmutable" {
DATATYPE "/_types/3"
DATASPACE SCALAR
DATA {
(0): {
{
1,
2.2
},
{
3,
4.4,
5
}
}
}
}
DATASET "_require" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE NULL
DATA {
}
ATTRIBUTE "dims" {
DATATYPE H5T_STD_I64LE
DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
DATA {
(0): 0
}
}
ATTRIBUTE "julia type" {
DATATYPE H5T_STRING {
STRSIZE 53;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "Core.Array{Union(Core.ASCIIString,Core.UTF8String),1}"
}
}
}
GROUP "_types" {
DATATYPE "1" H5T_COMPOUND {
H5T_STD_I8LE "a";
H5T_IEEE_F64LE "b";
}
ATTRIBUTE "julia type" {
DATATYPE H5T_STRING {
STRSIZE 20;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "Main.SimpleImmutable"
}
}
DATATYPE "2" H5T_COMPOUND {
H5T_STD_I64LE "1";
H5T_IEEE_F64LE "2";
H5T_STD_U8LE "3";
}
ATTRIBUTE "julia type" {
DATATYPE H5T_STRING {
STRSIZE 36;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "(Core.Int64,Core.Float64,Core.Uint8)"
}
}
DATATYPE "3" H5T_COMPOUND {
H5T_COMPOUND {
H5T_STD_I8LE "a";
H5T_IEEE_F64LE "b";
} "a";
H5T_COMPOUND {
H5T_STD_I64LE "1";
H5T_IEEE_F64LE "2";
H5T_STD_U8LE "3";
} "b";
}
ATTRIBUTE "julia type" {
DATATYPE H5T_STRING {
STRSIZE 21;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_ASCII;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "Main.ComplexImmutable"
}
}
}
}
}
using HDF5, JLD
immutable SimpleImmutable
a::Int8
b::Float64
end
immutable ComplexImmutable
a::SimpleImmutable
b::(Int, Float64, Uint8)
end
f = jldopen("test.jld", "w")
write(f, "ComplexImmutable", ComplexImmutable(SimpleImmutable(1, 2.2), (3, 4.4, 0x05)))
close(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment