JuliaIO / HDF5.jl

Save and load data in the HDF5 file format from Julia
https://juliaio.github.io/HDF5.jl
MIT License
390 stars 143 forks source link

Add dset_no_attrs_hint support, h5f coverage up to v1.12 #944

Closed mkitti closed 2 years ago

mkitti commented 2 years ago

The primary focus of this pull request is to add

This pull request adds helpers for

The DatasetCreateProperties gains a no_attrs_hint property.

Increased support is added for H5F* functions in general, covering known functions up to HDF5 v1.12.

Apart of that effort, this pull request converts H5F_libver_* into an enum from a series of constants.

A practical benefit of the dset_no_attrs_hint enhancements is a smaller HDF5 file with data:

julia> h5open("test.h5", "w"; libver_bounds = :latest, meta_block_size = 294) do f
           HDF5.API.h5f_set_dset_no_attrs_hint(f, true)
           f["test"] = 0x1
           f["test"] |> HDF5.API.h5d_get_offset |> Int
       end
294

julia> filesize("test.h5")
295

julia> h5open("test.h5", "w"; libver_bounds = :latest, meta_block_size = 294) do f
           HDF5.API.h5f_set_dset_no_attrs_hint(f, false)
           f["test"] = 0x1
           f["test"] |> HDF5.API.h5d_get_offset |> Int
       end
479

julia> filesize("test.h5")
480
mkitti commented 2 years ago

Only failure is codecov on functions.jl since I just added a bunch of bindings from LibHDF5.jl

simonbyrne commented 2 years ago

Looks like also a failure using the system hdf5 (which uses 1.10 I think)

mkitti commented 2 years ago

Good point. We need to gate at 1.10.5

https://docs.hdfgroup.org/hdf5/v1_12/group___h5_f.html#gacbf3ba8b36750c42b49740567a9732c4

Also does anyone know how to make doxygen URLs more readable?

simonbyrne commented 2 years ago

Isn't this the same information as https://portal.hdfgroup.org/display/HDF5/H5F_GET_DSET_NO_ATTRS_HINT?

mkitti commented 2 years ago

It is, I'm just worried that the newer doxygen based docs will replace the older docs at some point. Doxygen is geared more towards C++ though so they hash the method name and the argument types.

mkitti commented 2 years ago

Looks like also a failure using the system hdf5 (which uses 1.10 I think)

I fixed this. The remaining check fail is now truly code coverage.

mkitti commented 2 years ago

I broke and fixed this again. Main fail is due to codecov on src/api/functions.jl since I added the h5f bindings.