Skip to content

Commit bec2017

Browse files
authored
Add filters documentation (JuliaIO#901)
* Add filters documentation * Fix typo * Rearrange filters.md * Add named header id tags for API * Add create_dataset documentation * Cross ref dataset properties
1 parent 88f1d76 commit bec2017

File tree

18 files changed

+305
-53
lines changed

18 files changed

+305
-53
lines changed

docs/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
H5Zblosc = "c8ec2601-a99c-407f-b158-e79c03c2f5f7"
4+
H5Zbzip2 = "094576f2-1e46-4c84-8e32-c46c042eaaa2"
5+
H5Zlz4 = "eb20ec05-5464-47b5-ba41-098e3c1068a3"
6+
H5Zzstd = "f6f2d980-1ec6-471c-a70d-0270e22f1103"
37
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
48
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"

docs/make.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
using Documenter
22
using HDF5
3+
using H5Zblosc
4+
using H5Zbzip2
5+
using H5Zlz4
6+
using H5Zzstd
37
using MPI # needed to generate docs for parallel HDF5 API
48

59
# Used in index.md to filter the autodocs list
@@ -17,7 +21,7 @@ not_low_level_api(::typeof(HDF5.API.h5t_get_tag)) = false
1721

1822
makedocs(;
1923
sitename="HDF5.jl",
20-
modules=[HDF5],
24+
modules=[HDF5, H5Zblosc, H5Zbzip2, H5Zlz4, H5Zzstd],
2125
authors="Mustafa Mohamad <mus-m@outlook.com> and contributors",
2226
format=Documenter.HTML(;
2327
prettyurls=get(ENV, "CI", "false") == "true",
@@ -28,7 +32,9 @@ makedocs(;
2832
pages=[
2933
"Home" => "index.md",
3034
"Interface" => [
35+
"dataset.md",
3136
"properties.md",
37+
"filters.md"
3238
],
3339
"Low-level library bindings" => "api_bindings.md",
3440
],

docs/src/api_bindings.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ documented here.
2222

2323
---
2424

25-
## [`H5`](https://portal.hdfgroup.org/display/HDF5/Library) — General Library Functions
25+
## [[`H5`](https://portal.hdfgroup.org/display/HDF5/Library) — General Library Functions](@id H5)
2626
- [`h5_close`](@ref h5_close)
2727
- [`h5_dont_atexit`](@ref h5_dont_atexit)
2828
- [`h5_free_memory`](@ref h5_free_memory)
@@ -44,7 +44,7 @@ h5_set_free_list_limits
4444

4545
---
4646

47-
## [`H5A`](https://portal.hdfgroup.org/display/HDF5/Attributes) — Attribute Interface
47+
## [[`H5A`](https://portal.hdfgroup.org/display/HDF5/Attributes) — Attribute Interface](@id H5A)
4848
- [`h5a_close`](@ref h5a_close)
4949
- [`h5a_create`](@ref h5a_create)
5050
- [`h5a_create_by_name`](@ref h5a_create_by_name)
@@ -84,7 +84,7 @@ h5a_write
8484

8585
---
8686

87-
## [`H5D`](https://portal.hdfgroup.org/display/HDF5/Datasets) — Dataset Interface
87+
## [[`H5D`](https://portal.hdfgroup.org/display/HDF5/Datasets) — Dataset Interface](@id H5D)
8888
- [`h5d_close`](@ref h5d_close)
8989
- [`h5d_create`](@ref h5d_create)
9090
- [`h5d_extend`](@ref h5d_extend)
@@ -146,7 +146,7 @@ h5d_write_chunk
146146

147147
---
148148

149-
## [`H5E`](https://portal.hdfgroup.org/display/HDF5/Error+Handling) — Error Interface
149+
## [[`H5E`](https://portal.hdfgroup.org/display/HDF5/Error+Handling) — Error Interface](@id H5E)
150150
- [`h5e_close_stack`](@ref h5e_close_stack)
151151
- [`h5e_get_auto`](@ref h5e_get_auto)
152152
- [`h5e_get_current_stack`](@ref h5e_get_current_stack)
@@ -166,7 +166,7 @@ h5e_walk
166166

167167
---
168168

169-
## [`H5F`](https://portal.hdfgroup.org/display/HDF5/Files) — File Interface
169+
## [[`H5F`](https://portal.hdfgroup.org/display/HDF5/Files) — File Interface](@id H5F)
170170
- [`h5f_close`](@ref h5f_close)
171171
- [`h5f_create`](@ref h5f_create)
172172
- [`h5f_flush`](@ref h5f_flush)
@@ -198,7 +198,7 @@ h5f_start_swmr_write
198198

199199
---
200200

201-
## [`H5G`](https://portal.hdfgroup.org/display/HDF5/Groups) — Group Interface
201+
## [[`H5G`](https://portal.hdfgroup.org/display/HDF5/Groups) — Group Interface](@id H5G)
202202
- [`h5g_close`](@ref h5g_close)
203203
- [`h5g_create`](@ref h5g_create)
204204
- [`h5g_get_create_plist`](@ref h5g_get_create_plist)
@@ -218,7 +218,7 @@ h5g_open
218218

219219
---
220220

221-
## [`H5I`](https://portal.hdfgroup.org/display/HDF5/Identifiers) — Identifier Interface
221+
## [[`H5I`](https://portal.hdfgroup.org/display/HDF5/Identifiers) — Identifier Interface](@id H5I)
222222
- [`h5i_dec_ref`](@ref h5i_dec_ref)
223223
- [`h5i_get_file_id`](@ref h5i_get_file_id)
224224
- [`h5i_get_name`](@ref h5i_get_name)
@@ -238,7 +238,7 @@ h5i_is_valid
238238

239239
---
240240

241-
## [`H5L`](https://portal.hdfgroup.org/display/HDF5/Links) — Link Interface
241+
## [[`H5L`](https://portal.hdfgroup.org/display/HDF5/Links) — Link Interface](@id H5L)
242242
- [`h5l_create_external`](@ref h5l_create_external)
243243
- [`h5l_create_hard`](@ref h5l_create_hard)
244244
- [`h5l_create_soft`](@ref h5l_create_soft)
@@ -262,7 +262,7 @@ h5l_move
262262

263263
---
264264

265-
## [`H5O`](https://portal.hdfgroup.org/display/HDF5/Objects) — Object Interface
265+
## [[`H5O`](https://portal.hdfgroup.org/display/HDF5/Objects) — Object Interface](@id H5O)
266266
- [`h5o_close`](@ref h5o_close)
267267
- [`h5o_copy`](@ref h5o_copy)
268268
- [`h5o_get_info`](@ref h5o_get_info)
@@ -280,7 +280,7 @@ h5o_open_by_idx
280280

281281
---
282282

283-
## [`H5P`](https://portal.hdfgroup.org/display/HDF5/Property+Lists) — Property Interface
283+
## [[`H5P`](https://portal.hdfgroup.org/display/HDF5/Property+Lists) — Property Interface](@id H5P)
284284
- [`h5p_close`](@ref h5p_close)
285285
- [`h5p_create`](@ref h5p_create)
286286
- [`h5p_get_alignment`](@ref h5p_get_alignment)
@@ -384,7 +384,7 @@ h5p_set_virtual
384384

385385
---
386386

387-
## [`H5R`](https://portal.hdfgroup.org/display/HDF5/References) — Reference Interface
387+
## [[`H5R`](https://portal.hdfgroup.org/display/HDF5/References) — Reference Interface](@id H5R)
388388
- [`h5r_create`](@ref h5r_create)
389389
- [`h5r_dereference`](@ref h5r_dereference)
390390
- [`h5r_get_obj_type`](@ref h5r_get_obj_type)
@@ -398,7 +398,7 @@ h5r_get_region
398398

399399
---
400400

401-
## [`H5S`](https://portal.hdfgroup.org/display/HDF5/Dataspaces) — Dataspace Interface
401+
## [[`H5S`](https://portal.hdfgroup.org/display/HDF5/Dataspaces) — Dataspace Interface](@id H5S)
402402
- [`h5s_close`](@ref h5s_close)
403403
- [`h5s_combine_select`](@ref h5s_combine_select)
404404
- [`h5s_copy`](@ref h5s_copy)
@@ -438,7 +438,7 @@ h5s_set_extent_simple
438438

439439
---
440440

441-
## [`H5T`](https://portal.hdfgroup.org/display/HDF5/Datatypes) — Datatype Interface
441+
## [[`H5T`](https://portal.hdfgroup.org/display/HDF5/Datatypes) — Datatype Interface](@id H5T)
442442
- [`h5t_array_create`](@ref h5t_array_create)
443443
- [`h5t_close`](@ref h5t_close)
444444
- [`h5t_commit`](@ref h5t_commit)
@@ -520,15 +520,15 @@ h5t_vlen_create
520520

521521
---
522522

523-
## [`H5Z`](https://portal.hdfgroup.org/display/HDF5/Filters) — Filter Interface
523+
## [[`H5Z`](https://portal.hdfgroup.org/display/HDF5/Filters) — Filter Interface](@id H5Z)
524524
- [`h5z_register`](@ref h5z_register)
525525
```@docs
526526
h5z_register
527527
```
528528

529529
---
530530

531-
## [`H5DO`](https://portal.hdfgroup.org/display/HDF5/Optimizations) — Optimized Functions Interface
531+
## [[`H5DO`](https://portal.hdfgroup.org/display/HDF5/Optimizations) — Optimized Functions Interface](@id H5DO)
532532
- [`h5do_append`](@ref h5do_append)
533533
- [`h5do_write_chunk`](@ref h5do_write_chunk)
534534
```@docs
@@ -538,7 +538,7 @@ h5do_write_chunk
538538

539539
---
540540

541-
## [`H5DS`](https://portal.hdfgroup.org/display/HDF5/Dimension+Scales) — Dimension Scale Interface
541+
## [[`H5DS`](https://portal.hdfgroup.org/display/HDF5/Dimension+Scales) — Dimension Scale Interface](@id H5DS)
542542
- [`h5ds_attach_scale`](@ref h5ds_attach_scale)
543543
- [`h5ds_detach_scale`](@ref h5ds_detach_scale)
544544
- [`h5ds_get_label`](@ref h5ds_get_label)
@@ -562,15 +562,15 @@ h5ds_set_scale
562562

563563
---
564564

565-
## [`H5LT`](https://portal.hdfgroup.org/display/HDF5/Lite) — Lite Interface
565+
## [[`H5LT`](https://portal.hdfgroup.org/display/HDF5/Lite) — Lite Interface](@id H5LT)
566566
- [`h5lt_dtype_to_text`](@ref h5lt_dtype_to_text)
567567
```@docs
568568
h5lt_dtype_to_text
569569
```
570570

571571
---
572572

573-
## [`H5TB`](https://portal.hdfgroup.org/display/HDF5/Tables) — Table Interface
573+
## [[`H5TB`](https://portal.hdfgroup.org/display/HDF5/Tables) — Table Interface](@id H5TB)
574574
- [`h5tb_append_records`](@ref h5tb_append_records)
575575
- [`h5tb_get_field_info`](@ref h5tb_get_field_info)
576576
- [`h5tb_get_table_info`](@ref h5tb_get_table_info)

docs/src/dataset.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Dataset
2+
3+
Many dataset operations are available through the indexing interface, which is aliased to the functional interface. Below describes the functional interface.
4+
5+
```@docs
6+
create_dataset
7+
```

docs/src/filters.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Filters
2+
3+
HDF5 supports filters for compression and validation: these are applied sequentially to
4+
each chunk of a dataset when writing data, and in reverse order when reading data.
5+
6+
```@meta
7+
CurrentModule = HDF5
8+
```
9+
10+
These can be set by passing a filter or vector of filters as a `filters` property to
11+
[`DatasetCreateProperties`](@ref) or via the `filters` keyword argument of [`create_dataset`](@ref).
12+
13+
```@meta
14+
CurrentModule = HDF5.Filters
15+
```
16+
17+
## Example
18+
19+
```@docs
20+
Filters
21+
```
22+
23+
## Built-in Filters
24+
25+
26+
```@docs
27+
Deflate
28+
Shuffle
29+
Fletcher32
30+
Szip
31+
NBit
32+
ScaleOffset
33+
UnknownFilter
34+
```
35+
36+
## External Filter Packages
37+
38+
Several external Julia packages implement HDF5 filter plugins in Julia.
39+
As they are independent of HDF5.jl, they must be installed in order to use their plugins.
40+
41+
The
42+
[H5Zblosc.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zblosc),
43+
[H5Zbzip2.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zbzip2),
44+
[H5Zlz4.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zlz4), and
45+
[H5Zzstd.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zzstd) packages are maintained as
46+
independent subdirectory packages within the HDF5.jl repository.
47+
48+
### H5Zblosc.jl
49+
50+
```@meta
51+
CurrentModule = H5Zblosc
52+
```
53+
54+
```@docs
55+
BloscFilter
56+
```
57+
58+
### H5Zbzip2.jl
59+
60+
```@meta
61+
CurrentModule = H5Zbzip2
62+
```
63+
64+
```@docs
65+
Bzip2Filter
66+
```
67+
68+
### H5Zlz4.jl
69+
70+
```@meta
71+
CurrentModule = H5Zlz4
72+
```
73+
74+
```@docs
75+
Lz4Filter
76+
```
77+
78+
### H5Zzstd.jl
79+
80+
```@meta
81+
CurrentModule = H5Zzstd
82+
```
83+
84+
```@docs
85+
ZstdFilter
86+
```
87+
88+
## Other External Filters
89+
90+
Additional filters can be dynamically loaded by the HDF5 library. See [External Links](@ref) below for more information.
91+
92+
## Filter Interface
93+
94+
```@meta
95+
CurrentModule = HDF5.Filters
96+
```
97+
98+
The filter interface is used to describe filters and obtain information on them.
99+
100+
```@docs
101+
Filter
102+
FilterPipeline
103+
FILTERS
104+
filterid
105+
encoder_present
106+
decoder_present
107+
filtername
108+
can_apply_func
109+
can_apply_cfunc
110+
set_local_func
111+
set_local_cfunc
112+
filter_func
113+
filter_cfunc
114+
register_filter
115+
```
116+
117+
## External Links
118+
119+
* A [list of registered filter plugins](https://portal.hdfgroup.org/display/support/Registered+Filter+Plugins) can be found on the HDF Group website.
120+
* [See the HDF5 Documentation of HDF5 Filter Plugins for details.](https://portal.hdfgroup.org/display/support/HDF5+Filter+Plugins)
121+
* The source code for many external plugins have been collected in the [HDFGroup hdf5_plugins repository](https://github.com/HDFGroup/hdf5_plugins).
122+
* [Compiled binaries of dynamically downloaded plugins](https://portal.hdfgroup.org/display/support/Downloads) by downloaded from HDF5 Group.

docs/src/properties.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,12 @@ FileAccessProperties
2121
FileCreateProperties
2222
GroupCreateProperties
2323
DatasetCreateProperties
24+
DatasetAccessProperties
2425
DatasetTransferProperties
2526
LinkCreateProperties
2627
ObjectCreateProperties
27-
```
28-
29-
## Filters
30-
31-
HDF5 supports filters for compression and validation: these are applied sequentially to
32-
each chunk of a dataset when writing data, and in reverse order when reading data.
33-
34-
These can be set by passing a filter or vector of filters as a `filter` property to
35-
[`DatasetCreateProperties`](@ref).
36-
37-
```@meta
38-
CurrentModule = HDF5.Filters
39-
```
40-
41-
```@docs
42-
FilterPipeline
43-
Deflate
44-
Shuffle
45-
Fletcher32
46-
Szip
47-
NBit
48-
ScaleOffset
49-
BloscFilter
28+
StringCreateProperties
29+
DatatypeCreateProperties
5030
```
5131

5232
## Drivers

filters/H5Zblosc/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# H5Zblosc.jl
2+
3+
Implements the Blosc filter for [HDF5.jl](https://github.com/JuliaIO/HDF5.jl) in Julia.
4+
See the [documentation](https://juliaio.github.io/HDF5.jl/stable/filters/#H5Zblosc.jl)
5+
6+
This implements [HDF5 filter ID 32001](https://portal.hdfgroup.org/display/support/Filters#Filters-32001)

filters/H5Zblosc/src/H5Zblosc.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Blosc
55
using HDF5.API
66
import HDF5.Filters: Filter, FilterPipeline
77
import HDF5.Filters: filterid, register_filter, filtername, filter_func, filter_cfunc, set_local_func, set_local_cfunc
8+
import HDF5.Filters.Shuffle
89

910
export H5Z_FILTER_BLOSC, blosc_filter, BloscFilter
1011

@@ -124,7 +125,9 @@ The Blosc compression filter, using [Blosc.jl](https://github.com/JuliaIO/Blosc.
124125
- `compressor`: the compression algorithm. Call `Blosc.compressors()` for the available compressors.
125126
126127
# External links
127-
- [What Is Blosc?](https://www.blosc.org/pages/blosc-in-depth/)
128+
* [What Is Blosc?](https://www.blosc.org/pages/blosc-in-depth/)
129+
* [Blosc HDF5 Filter ID 32001](https://portal.hdfgroup.org/display/support/Filters#Filters-32001)
130+
* [Blosc HDF5 Plugin Repository (C code)](https://github.com/Blosc/hdf5-blosc)
128131
"""
129132
struct BloscFilter <: Filter
130133
blosc_version::Cuint

0 commit comments

Comments
 (0)