I am using JLD2 to store some data in struct
format, it works great. However some of the objects need to change, as I need to add more members.
e.g.
struct A
n::Int
a::String
end
might become
struct A
n::Int
a::String
b::String
end
when I read an old object with the new code it gives me this warning:
┌ Warning: saved type A is missing field b in workspace type; reconstructing
└ @ JLD2 C:\.julia\packages\JLD2\k9Gt0\src\data\reconstructing_datatypes.jl:152
this is fine, the behavior is described here:
https://github.com/JuliaIO/JLD2.jl/blob/master/docs/src/advanced.md
However I am not sure how the proposed type remapping with typemap
could help me: I would like to be able to load the old object in the new format but providing a default for eventual new properties.
I remember with JLD I was used to leverage on features like JLD.readas
and JLD.translate
, is there anything similar with JLD2?