We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, consider the following example:
julia> using JLD julia> struct MyStruct σ end julia> a = MyStruct(5.5); julia> save("tmp.jld", "a", a);
Then I restart the julia terminal,
julia> using JLD julia> load("tmp.jld", "a") ┌ Warning: type MyStruct not present in workspace; reconstructing └ @ JLD ~/.julia/packages/JLD/1BoSz/src/jld_types.jl:703 ERROR: StringIndexError("σ_", 2) Stacktrace: [1] string_index_err(::String, ::Int64) at ./strings/string.jl:12 [2] getindex(::String, ::UnitRange{Int64}) at ./strings/string.jl:246 [3] reconstruct_type(::JLD.JldFile, ::HDF5.HDF5Datatype, ::String) at /Users/spc/.julia/packages/JLD/1BoSz/src/jld_types.jl:762 [4] macro expansion at ./logging.jl:305 [inlined] [5] jldatatype(::JLD.JldFile, ::HDF5.HDF5Datatype) at /Users/spc/.julia/packages/JLD/1BoSz/src/jld_types.jl:703 [6] read(::JLD.JldDataset) at /Users/spc/.julia/packages/JLD/1BoSz/src/JLD.jl:370 [7] read(::JLD.JldFile, ::String) at /Users/spc/.julia/packages/JLD/1BoSz/src/JLD.jl:346 [8] #42 at /Users/spc/.julia/packages/JLD/1BoSz/src/JLD.jl:1240 [inlined] [9] #jldopen#14(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(JLD, Symbol("##42#43")){String}, ::String, ::Vararg{String,N} where N) at /Users/spc/.julia/packages/JLD/1BoSz/src/JLD.jl:246 [10] jldopen at /Users/spc/.julia/packages/JLD/1BoSz/src/JLD.jl:244 [inlined] [11] load at /Users/spc/.julia/packages/JLD/1BoSz/src/JLD.jl:1239 [inlined] [12] #load#13(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String, ::String) at /Users/spc/.julia/packages/FileIO/lt9I0/src/loadsave.jl:118 [13] load(::String, ::String) at /Users/spc/.julia/packages/FileIO/lt9I0/src/loadsave.jl:118 [14] top-level scope at none:0
I am running:
julia> versioninfo() Julia Version 1.0.2 julia> JLD.version_current v"0.1.2"
It would be fine if the fieldname is something like "a", "b", etc. I think that may be related to this. Could be nice if this is improved. Thanks!
The text was updated successfully, but these errors were encountered:
same here inside reconstruct_type method it finds index and then takes substring
reconstruct_type
idx = first(something(findlast("_", membername), 0:-1)) fieldname = fieldnames[i] = Symbol(membername[1:idx-1])
in calculation idx = 3 and we end up with
idx = 3
ulia> "μ_"[1:2] ERROR: StringIndexError("μ_", 2) julia> "ab"[1:2] "ab" julia> "μ_"[1] 'μ': Unicode U+03bc (category Ll: Letter, lowercase) julia> "μ_"[2] ERROR: StringIndexError("μ_", 2)
Sorry, something went wrong.
Issue JuliaIO#235: reconstructing type with non-ascii attribute names
70967d2
Issue #235: reconstructing type with non-ascii attribute names (#250)
43e9a4a
No branches or pull requests
Hello, consider the following example:
Then I restart the julia terminal,
I am running:
It would be fine if the fieldname is something like "a", "b", etc. I think that may be related to this. Could be nice if this is improved. Thanks!
The text was updated successfully, but these errors were encountered: