Open IanButterworth opened 5 years ago
Also, is there any reason to not do this with JLD, over HDF5.jl etc.? I'm using JLD as there were examples, and I couldn't immediately find how to use custom types in HDF5
I just realized that the error above is a <1.0 error that's fixed in master. It would be good to push a new release out to catch that @JeffBezanson
Hi ! Is there a plan to make a tag a out of the latest master ? Facing the same issue...
Have the same issue, gives me ERROR: LoadError: UndefVarError: module_parent not defined
error. Test code attached.
debugCode.jl:
using JLD
push!(LOAD_PATH, pwd());
import debugTypes: Type1, Type2
import debugTypes
a = Type1(3.14);
b = Type2(100.0);
filepath = "test_data.jld"
jldopen(filepath,"w") do file
addrequire(file, debugTypes)
write(file, "a", a, "b", b)
end
debugTypes.jl:
module debugTypes
using Dates
export Type1, Type2
mutable struct Type1
var1::Float64
end
struct Type2
var2::Float64
end
end
I'd like to use JLD within a package to save custom types from that same package. What's the correct way to do this? Call the package itself from within
addrequire()
(which causes an error if I do it as below)? Or should the package inaddrequire()
be a lighter-weight types-only package? Is there a performance hit if it's the former?i.e. within the package
ThisPackage
, this errors