Closed duanhuaiyu closed 1 year ago
Thank you. This is a bug. Here's a minimum working example. Pull requests are welcome. Let me see if I can tackle this in a few minutes.
julia> using HDF5
julia> h5open("test.h5", "w") do h5f
create_dataset(h5f, "testds", UInt8, dataspace(16,16))
end
ERROR: MethodError: no method matching create_dataset(::HDF5.File, ::String, ::Type{UInt8}, ::HDF5.Dataspace)
Closest candidates are:
create_dataset(::Union{HDF5.File, HDF5.Group}, ::Union{Nothing, AbstractString}, ::HDF5.Datatype, ::HDF5.Dataspace; dcpl, dxpl, dapl, pv...)
@ HDF5 ~/.julia/dev/HDF5/src/datasets.jl:44
create_dataset(::Union{HDF5.File, HDF5.Group}, ::Union{Nothing, AbstractString}, ::Type, ::Tuple{Tuple{Vararg{Int64, N}} where N, Tuple{Vararg{Int64, N}} where N}; pv...)
@ HDF5 ~/.julia/dev/HDF5/src/datasets.jl:94
create_dataset(::Union{HDF5.File, HDF5.Group}, ::Union{Nothing, AbstractString}, ::Type, ::Tuple{Vararg{Int64, N}} where N; pv...)
@ HDF5 ~/.julia/dev/HDF5/src/datasets.jl:107
...
Let me know if you would like to submit a test case.
See #1086
According to the documentation of
create_dataset(parent, path, datatype, dataspace; properties...)
,datatype
can be eitherDatatype
orType
, anddataspace
can be eitherDataspace
orDims
. However, it throws an error if one usesdatatype::Type
withdataspace::Dataspace
.