Hi everyone, a couple of years ago a created some interpolated functions with Interpolations.jl and saved then to files in JLD2. I used them a lot back in the day, but trying to load them now (new computer, new OS, new Julia and new packages versions) proves impossible.
I can do
@load "Mantle_Vp.jld"
and get:
┌ Warning: saved type Interpolations.GriddedInterpolation{Float64, 4, Float64, Gridded{Linear}, NTuple{4, Vector{Int64}}} is missing field it in workspace type; reconstructing
└ @ JLD2 ~/.julia/packages/JLD2/ryhNR/src/data/reconstructing_datatypes.jl:164
1-element Vector{Symbol}:
:Mantle_Vp
If I type the name of the variable Mantle_Vp I can see all the interpolated data is there, but it is not callable.
julia> Mantle_Vp(100,20000,3.6,8.0)
ERROR: MethodError: objects of type JLD2.ReconstructedTypes.var"##Interpolations.GriddedInterpolation{Float64, 4, Float64, Gridded{Linear}, NTuple{4, Vector{Int64}}}#296" are not callable
Stacktrace:
[1] top-level scope
@ REPL[24]:1
Can I output this to a variable to reinterpolate and resave so I can have access to my data again?
Re-create the environment setup you used to create JLD2 file (if you have Project.toml and Manifest.toml files this should be doable relatively easily)
Read the data into Julia in this environment.
Save it in some format that is package-version independent.
JLD2 is a subset of hdf5,
so you might be able to inspect the file and load the data (with HDF5),
and from this data instantiate an Interpolations.GriddedInterpolation
or the equivalent in your version of Interpolations.jl ?
The warning refers to a specific field GriddedInterpolation.it. Instead of reconstructing from HDF5 data, you might try finding out the last version of Interpolation before the it field was added (e.g. using “blame” on github) and loading the JLD file with that version.