You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some data that I saved as a "data.jl2" file with Julia 1.6 (I probably saved it with julia 1.3 actually but it shouldn't matter) and I cannot read it with the new julia version 1.7. I get the following error:
┌ Warning: read type StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}} is not a leaf type in workspace; reconstructing
└ @ JLD2 ~/.julia/packages/JLD2/DcnTD/src/data/reconstructing_datatypes.jl:231
Error encountered while load FileIO.File{FileIO.DataFormat{:JLD2}, String}("data.jld2").
Fatal error:
TypeError: in <:, expected Type, got a value of type JLD2.OnDiskRepresentation{(0, 16, 32, 40), Tuple{Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64, Int64}, Tuple{Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64, Int64}}
The data is actually a DataFrame, where one column has element types from a custom struct named DataSetGcamp.
This struct is holding the data is various attributes, being dictionaries or dataframes.
It seems the problem comes from loading StepRangeLen types (most probably LinRange is affected also) because the struct parameters changed in julia1.7: JuliaLang/julia#41619
It now has 4 parameters and just 3 in julia 1.6.
I'm not sure, there is a good solution for you.
I'd say, it's probably easiest to continue using julia v1.6 for this project if that is an option.
Alternatively, I'd recommend you load the data in julia v1.6 and convert it to not use those datatypes and re-save.
Since this is a change in a Base-type, many of the typical workarounds probably won't work.
Nonetheless, the error message by itself is odd and I'll classify this as as bug.
Interesting, that looks very similar to the type remapping that I implemented for #316.
There, I needed it since anonymous functions really shouldn't be reconstructed with their original name.
Though, I did that on a by-file basis.
I suppose, one could add that feature independently, even if #316 or #338 will probably never be finished.
Julia: v1.7.0
JLD2.jl: v0.4.15
I have some data that I saved as a "data.jl2" file with Julia 1.6 (I probably saved it with julia 1.3 actually but it shouldn't matter) and I cannot read it with the new julia version 1.7. I get the following error:
The data is actually a DataFrame, where one column has element types from a custom struct named DataSetGcamp.
This struct is holding the data is various attributes, being dictionaries or dataframes.
It seems the problem comes from loading
StepRangeLen
types (most probablyLinRange
is affected also) because the struct parameters changed in julia1.7: JuliaLang/julia#41619It now has 4 parameters and just 3 in julia 1.6.
I tried Custom Serialization to no avail:
Any other idea would be much appreciated!
Full traceback:
https://gist.github.com/getzze/fe069212fb4bb2a510422a76bce33630
The text was updated successfully, but these errors were encountered: