JuliaIO / JLD.jl

Saving and loading julia variables while preserving native types
MIT License
277 stars 55 forks source link

Slashes in dictionary keys #278

Open lhupe opened 4 years ago

lhupe commented 4 years ago

JLD seems to interpret slashes in dictionary keys as a group hierarchy, as demonstrated by this MWE,

using JLD

data = Dict(
    "/foo/bar" => "some data",
    "/foo/baz" => "more data"
)

JLD.save("mwe.jld", data)

data2 = JLD.load("mwe.jld")
println(data2)

which will print

Dict{String,Any}("foo" => Dict{String,Any}("bar" => "some data","baz" => "more data"))

Is this an undocumented feature or a bug?

lhupe commented 4 years ago

I noticed that in the docs file, this behaviour is used without explicitely explaining what it does, so I guess this counts as a feature. It'd be nice if it were documented explicitely, because to users without a basic knowledge of HDF5, this might be a bit confusing.