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

Using Type and Dataspace in create_dataset() #1084

Closed
duanhuaiyu opened this issue Jun 28, 2023 · 2 comments · Fixed by #1086
Closed

Using Type and Dataspace in create_dataset() #1084

duanhuaiyu opened this issue Jun 28, 2023 · 2 comments · Fixed by #1086

Comments

@duanhuaiyu
Copy link

According to the documentation of create_dataset(parent, path, datatype, dataspace; properties...), datatype can be either Datatype or Type, and dataspace can be either Dataspace or Dims. However, it throws an error if one uses datatype::Type with dataspace::Dataspace.

@mkitti
Copy link
Member

mkitti commented Jun 29, 2023

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.

mkitti added a commit to mkitti/HDF5.jl that referenced this issue Jun 29, 2023
Also expand definitions for dataspace with two positional arguments.
Pin Blosc_jll to 1.21.2 if AVX2 is not detected. See Blosc/c-blosc#371
@mkitti
Copy link
Member

mkitti commented Jun 29, 2023

See #1086

mkitti added a commit that referenced this issue Jul 6, 2023
* Fix #1083 maxdims -> max_dims in dataspace documentation

* Fix #1084, create_dataset with Type and Dataspace

Also expand definitions for dataspace with two positional arguments.
Pin Blosc_jll to 1.21.2 if AVX2 is not detected. See Blosc/c-blosc#371

* Formatter
mkitti added a commit to mkitti/HDF5.jl that referenced this issue Aug 20, 2023
…uliaIO#1086)

* Fix JuliaIO#1083 maxdims -> max_dims in dataspace documentation

* Fix JuliaIO#1084, create_dataset with Type and Dataspace

Also expand definitions for dataspace with two positional arguments.
Pin Blosc_jll to 1.21.2 if AVX2 is not detected. See Blosc/c-blosc#371

* Formatter
mkitti added a commit that referenced this issue Aug 23, 2023
* Fix _typed_load fast path for Julia 1.10 (currently nightly) (#1075)

* Fix _typed_load fast path for Julia 1.10 (currently nightly) by thresholding on `1.10.0-DEV.1390`
* Use `Libc.memcpy` after that threshold

* Add initial support for H5Dchunk_iter (#1031)

* Add initial support for H5Dchunk_iter

* Implement h5d_chunk_iter_helper

* Implement HDF5.get_all_chunk_info

* Make tests pass via HDF5 1.14.0

* Apply formatting

* Test filters with filter_mask via H5Dchunk_iter

* Require functions to return an integer

* Provide index based chunk iteration, rename to HDF5.get_chunk_info_all

* Fix formatting

* Fix documentation

* Fix documentation

* Improve testing

* Always define _get_chunk_info_all_by_iter for documenter

* Update src/datasets.jl

Co-authored-by: Simon Byrne <[email protected]>

* Precompile get_chunk_info_all implementations before benchmarking

* Fix documentation

* Fix tests

* Formatting

---------

Co-authored-by: Simon Byrne <[email protected]>

* Simplify formatter check (#1078)

This will display the diff, and return a non-zero exit code if there are changes

* Fix #1083 maxdims -> max_dims in dataspace documentation (#1085)

* Update light and dark logos for readme (#1087)

* Fixup readme logo links and readme style (#1088)

* Fixup readme logo links and readme style

* Tweak

* Tweak logo centering

* Upload curves directly instead of fonts for logo independence (#1089)

* Allow create_dataset to take a Type and Dataspace, Fix #1084 (#1086)

* Fix #1083 maxdims -> max_dims in dataspace documentation

* Fix #1084, create_dataset with Type and Dataspace

Also expand definitions for dataspace with two positional arguments.
Pin Blosc_jll to 1.21.2 if AVX2 is not detected. See Blosc/c-blosc#371

* Formatter

* Attempt to fix documentation (#1091)

* doc typo: attributes(parent), not attribute(parent) (#1095)

* Fix tests for Julia 1.3

* Fix tests for Julia 1.3, Windows SZIP is broken again

* Use static if block to fix 1.3

* Fix version and formatting

* Fix tests

* Bump version to 0.16.16

* Formatting

---------

Co-authored-by: Simon Byrne <[email protected]>
Co-authored-by: Mustafa M <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants