-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Hi!
I have some problems with loading saved Interpolants again. My original problem (see #99) dissapeared with a update a few days later.
However right now I am trying to organize my code in modules. My new code as a minimal working example looks as follows.
runfirst.jl:
using JLD2, FileIO
using Interpolations
x = [-1, 0, 1, 2]
y = x.^2
intp = interpolate( (x,), y, Gridded( Linear()))
@save "f.jld2" intp
tmp.jl:
push!( LOAD_PATH, pwd())
using JLD2, FileIO
using Interpolations
using TMPModule
println( "Test: $(intp(1.5))")
TMPModule.jl:
module TMPModule
using JLD2, FileIO
using Interpolations
export intp
#=
# this works as expected!
x = [-1, 0, 1, 2]
y = x.^2
intp = interpolate( (x,), y, Gridded( Linear()))
# =#
# this does not work
@load "f.jld2" intp
end
The @load command in TMPModule causes the following error, whereas if I generated the variable intp as demonstraded in the code that is commented out everything would work as I would love it to.
┌ Warning: type Interpolations.Interpolations.GriddedInterpolation{Float64,1,Int64,Interpolations.Interpolations.Gridded{Interpolations.Interpolations.Linear},Tuple{Array{Int64,1}}} does not exist in workspace; reconstructing
└ @ JLD2 C:\Users\homer.julia\packages\JLD2\KjBIK\src\data.jl:1154
WARNING: eval into closed module ReconstructedTypes:
Expr(:struct_type, Symbol("##Interpolations.Interpolations.GriddedInterpolation{Float64,1,Int64,Interpolations.Interpolations.Gridded{Interpolations.Interpolations.Linear},Tuple{Array{Int64,1}}}#363"), svec(), svec(:knots, :coefs), Any, svec(Tuple{Array{Int64, 1}}, Any), false, 0)
** incremental compilation may be broken for this module **