Closed alyst closed 1 month ago
MRE (Julia 1.10.4, JLD2 0.4.50):
using JLD2 tst = [("a",), ("a", "b")] @save("tst.jld2", tst) @load("tst.jld2", tst)
Where tst is of type
tst
julia> typeof(tst) Vector{Tuple{String, Vararg{String}}} (alias for Array{Tuple{String, Vararg{String}}, 1})
Results in
LoadError: MethodError: Cannot `convert` an object of type Tuple{String} to an object of type Tuple{String,String} Closest candidates are: convert(::Type{T}, ::Tuple{Vararg{Any, N}}) where {N, T<:Tuple} @ Base essentials.jl:457 convert(::Type{T}, ::T) where T<:Tuple @ Base essentials.jl:456 convert(::Type{T}, ::Intervals.Interval{T}) where T @ Intervals ~/.julia/packages/Intervals/V53WF/src/interval.jl:240 ... Stacktrace: [1] _tuple_error(T::Type, x::Tuple{String}) @ Base ./essentials.jl:454 [2] convert(::Type{Tuple{String, String}}, x::Tuple{String}) @ Base ./essentials.jl:461 [3] rconvert(T::Type, x::Tuple{String}) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/data/custom_serialization.jl:9 [4] jlconvert(::JLD2.ReadRepresentation{Tuple{String, String}, JLD2.RelOffset}, f::JLD2.JLDFile{JLD2.MmapIO}, ptr::Ptr{Nothing}, ::JLD2.RelOffset) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/data/writing_datatypes.jl:315 [5] macro expansion @ ~/.julia/packages/JLD2/ifXF8/src/dataio.jl:70 [inlined] [6] macro expansion @ ./simdloop.jl:77 [inlined] [7] read_array!(v::Vector{Tuple{String, String}}, f::JLD2.JLDFile{JLD2.MmapIO}, rr::JLD2.ReadRepresentation{Tuple{String, String}, JLD2.RelOffset}) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/dataio.jl:68 [8] read_array(f::JLD2.JLDFile{JLD2.MmapIO}, dataspace::JLD2.ReadDataspace, rr::JLD2.ReadRepresentation, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{JLD2.ReadAttribute}) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/datasets.jl:411 [9] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, rr::JLD2.ReadRepresentation{Any, JLD2.RelOffset}, read_dataspace::Tuple{JLD2.ReadDataspace, JLD2.RelOffset, JLD2.DataLayout, JLD2.FilterPipeline}, attributes::Vector{JLD2.ReadAttribute}) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/datasets.jl:276 [10] macro expansion @ ~/.julia/packages/JLD2/ifXF8/src/datasets.jl:224 [inlined] [11] macro expansion @ ~/.julia/packages/JLD2/ifXF8/src/datatypes.jl:105 [inlined] [12] read_data(f::JLD2.JLDFile{JLD2.MmapIO}, dataspace::JLD2.ReadDataspace, datatype_class::UInt8, datatype_offset::Int64, layout::JLD2.DataLayout, filters::JLD2.FilterPipeline, header_offset::JLD2.RelOffset, attributes::Vector{JLD2.ReadAttribute}) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/datasets.jl:211 [13] load_dataset(f::JLD2.JLDFile{JLD2.MmapIO}, offset::JLD2.RelOffset) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/datasets.jl:125 [14] getindex(g::JLD2.Group{JLD2.JLDFile{JLD2.MmapIO}}, name::String) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/groups.jl:110 [15] read @ ~/.julia/packages/JLD2/ifXF8/src/JLD2.jl:488 [inlined] [16] (::var"#171#172")(f::JLD2.JLDFile{JLD2.MmapIO}) @ Main ~/.julia/packages/JLD2/ifXF8/src/loadsave.jl:146 [17] jldopen(f::Function, args::String; kws::@Kwargs{}) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/loadsave.jl:4 [18] jldopen(f::Function, args::String) @ JLD2 ~/.julia/packages/JLD2/ifXF8/src/loadsave.jl:1 [19] macro expansion @ ~/.julia/packages/JLD2/ifXF8/src/loadsave.jl:145 [inlined]
MRE (Julia 1.10.4, JLD2 0.4.50):
Where
tst
is of typeResults in