-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Description
Using HDF5.jl v0.17.2, attributes seem to have some weird caching problem that brings old values back from the dead. To recreate:
- Create/set an attribute to one value
- Delete the attribute
- Create/set the same attribute to a different value
- Reading the attribute value returns the originally written value, not the new value
- Closing and re-opening the file and re-reading the attribute gets the new value
julia> h5 = h5open("test.h5", "w")
ποΈ HDF5.File: (read-write) test.h5
julia> h5["data"] = rand(4,3);
julia> h5["data"]["attr"] = "foo"
"foo"
julia> h5
ποΈ HDF5.File: (read-write) test.h5
ββ π’ data
ββ π·οΈ attr
julia> h5["data"]["attr"][]
"foo"
julia> delete_attribute(h5["data"], "attr")
julia> h5
ποΈ HDF5.File: (read-write) test.h5
ββ π’ data
julia> h5["data"]["attr"][]
ERROR: KeyError: key "attr" not found
Stacktrace:
[1] getindex(dset::HDF5.Dataset, name::String)
@ HDF5 ~/.julia/packages/HDF5/Z859u/src/attributes.jl:403
[2] top-level scope
@ REPL[119]:1
julia> h5["data"]["attr"] = "bar"
"bar"
julia> h5["data"]["attr"][] # Should return "bar"!!!
"foo"
julia> close(h5)
julia> h5 = h5open("test.h5")
ποΈ HDF5.File: (read-only) test.h5
ββ π’ data
ββ π·οΈ attr
julia> h5["data"]["attr"][]
"bar"
Metadata
Metadata
Assignees
Labels
No labels