Skip to content
New issue

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

Fix HDF5.exists, HDF5.haddr_t, and HDF5.object_info deprecation warnings #325

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/JLD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ function write_ref(parent::JldFile, data, wsession::JldWriteSession)
dset = _write(gref, name, writeas(data), wsession)

# Add reference to reference list
ref = HDF5.Reference(HDF5.API.hobj_ref_t(object_info(dset).addr))
ref = HDF5.Reference(HDF5.API.hobj_ref_t(HDF5.API.h5o_get_info1(HDF5.checkvalid(dset)).addr))
close(dset)
if !isa(data, Tuple) && ismutable(data)
wsession.h5ref[data] = ref
Expand Down Expand Up @@ -1410,7 +1410,6 @@ include("JLD00.jl")
### v0.12.0 deprecations
###

import HDF5: exists
export exists
@noinline function exists(p::Union{JldFile, JldGroup, JldDataset}, path::String)
Base.depwarn("`exists(p, path)` is deprecated, use `haskey(p, path)` instead.", :exists)
Expand Down
6 changes: 3 additions & 3 deletions src/jld_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ function jldatatype(parent::JldFile, dtype::HDF5.Datatype)
elseif class_id == HDF5.API.H5T_BITFIELD
Bool
elseif class_id == HDF5.API.H5T_COMPOUND || class_id == HDF5.API.H5T_OPAQUE
addr = object_info(dtype).addr
addr = HDF5.API.h5o_get_info1(HDF5.checkvalid(dtype)).addr
haskey(parent.h5jltype, addr) && return parent.h5jltype[addr]

typename = read_attribute(dtype, name_type_attr)
Expand Down Expand Up @@ -805,11 +805,11 @@ end
# it's already many times faster than calling H5Iget_name with a lot of
# data in the file, and it only needs to be called once per type.
# Revisit if this ever turns out to be a bottleneck.
function typeindex(parent::JldFile, addr::HDF5.haddr_t)
function typeindex(parent::JldFile, addr::HDF5.API.haddr_t)
gtypes = parent.plain[pathtypes]
i = 1
for x in gtypes
if object_info(x).addr == addr
if HDF5.API.h5o_get_info1(HDF5.checkvalid(x)).addr == addr
return i
end
i += 1
Expand Down
Loading