Skip to content

Commit 08d030f

Browse files
authored
Convert H5Z*.jl packages into package extensions (#1160)
* Convert H5Z*.jl packages into package extensions * Fix tests for Julia 1.6, set filter pkgs to 0.2.0 * Fix formatting, docs. Import rather than alias symbols. * Apply formatting * Update docs for extension packages * Apply formatter * Add note in history
1 parent 641aa57 commit 08d030f

35 files changed

+1456
-1152
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Please also see the [release notes](https://github.com/JuliaIO/HDF5.jl/releases)
44

55
## v0.18.0 (in development)
66
* Refactor Dataspaces (#1104)
7+
* Convert filter packages into package extensions (#1160)
78

89
## v0.17.2
910
* Fix variable length strings as attributes (#1130)

Project.toml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,42 @@ version = "0.17.1"
66
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
77
HDF5_jll = "0234f1f7-429e-5d53-9886-15a909be8d59"
88
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
9+
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
910
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
1011
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1112
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1213
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1314
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1415
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
15-
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
16-
17-
[weakdeps]
18-
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
19-
20-
[extensions]
21-
MPIExt = "MPI"
2216

2317
[compat]
18+
Blosc = "0.7.3"
19+
CodecBzip2 = "0.7, 0.8"
20+
CodecLz4 = "0.4"
21+
CodecZstd = "0.7, 0.8"
2422
Compat = "3.1.0, 4"
2523
HDF5_jll = "~1.10.5, ~1.12.0, ~1.14.0"
2624
MPI = "0.20"
2725
MPIPreferences = "0.1.7"
2826
Preferences = "1.3"
2927
Requires = "1.0"
28+
bitshuffle_jll = "0.4.2, 0.5"
3029
julia = "1.6"
3130

31+
[extensions]
32+
BloscExt = "Blosc"
33+
CodecBzip2Ext = "CodecBzip2"
34+
CodecLz4Ext = "CodecLz4"
35+
CodecZstdExt = "CodecZstd"
36+
MPIExt = "MPI"
37+
bitshuffle_jll_ext = "bitshuffle_jll"
38+
3239
[extras]
40+
Blosc = "a74b3585-a348-5f62-a45c-50e91977d574"
3341
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
42+
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
43+
CodecLz4 = "5ba52731-8f18-5e0d-9241-30f10d1ec561"
44+
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
3445
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
3546
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
3647
H5Zblosc = "c8ec2601-a99c-407f-b158-e79c03c2f5f7"
@@ -42,6 +53,15 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
4253
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
4354
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
4455
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
56+
bitshuffle_jll = "228fe19c-1b83-5282-a626-13744502a320"
4557

4658
[targets]
4759
test = ["Test", "MPI", "Distributed", "LinearAlgebra", "OrderedCollections", "Pkg", "CRC32c", "FileIO"]
60+
61+
[weakdeps]
62+
Blosc = "a74b3585-a348-5f62-a45c-50e91977d574"
63+
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
64+
CodecLz4 = "5ba52731-8f18-5e0d-9241-30f10d1ec561"
65+
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
66+
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
67+
bitshuffle_jll = "228fe19c-1b83-5282-a626-13744502a320"

docs/Manifest.toml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,41 +145,46 @@ version = "2.46.2+0"
145145
deps = ["HDF5", "bitshuffle_jll"]
146146
path = "../filters/H5Zbitshuffle"
147147
uuid = "51b4e782-877f-4ccf-958a-27bf628210da"
148-
version = "0.1.3"
148+
version = "0.2.0"
149149

150150
[[deps.H5Zblosc]]
151151
deps = ["Blosc", "HDF5"]
152152
path = "../filters/H5Zblosc"
153153
uuid = "c8ec2601-a99c-407f-b158-e79c03c2f5f7"
154-
version = "0.1.2"
154+
version = "0.2.0"
155155

156156
[[deps.H5Zbzip2]]
157157
deps = ["CodecBzip2", "HDF5"]
158158
path = "../filters/H5Zbzip2"
159159
uuid = "094576f2-1e46-4c84-8e32-c46c042eaaa2"
160-
version = "0.1.2"
160+
version = "0.2.0"
161161

162162
[[deps.H5Zlz4]]
163163
deps = ["CodecLz4", "HDF5"]
164164
path = "../filters/H5Zlz4"
165165
uuid = "eb20ec05-5464-47b5-ba41-098e3c1068a3"
166-
version = "0.1.1"
166+
version = "0.2.0"
167167

168168
[[deps.H5Zzstd]]
169169
deps = ["CodecZstd", "HDF5"]
170170
path = "../filters/H5Zzstd"
171171
uuid = "f6f2d980-1ec6-471c-a70d-0270e22f1103"
172-
version = "0.1.2"
172+
version = "0.2.0"
173173

174174
[[deps.HDF5]]
175175
deps = ["Compat", "HDF5_jll", "Libdl", "MPIPreferences", "Mmap", "Preferences", "Printf", "Random", "Requires", "UUIDs"]
176176
path = ".."
177177
uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
178178
version = "0.17.1"
179-
weakdeps = ["MPI"]
179+
weakdeps = ["Blosc", "CodecBzip2", "CodecLz4", "CodecZstd", "MPI", "bitshuffle_jll"]
180180

181181
[deps.HDF5.extensions]
182+
BloscExt = "Blosc"
183+
CodecBzip2Ext = "CodecBzip2"
184+
CodecLz4Ext = "CodecLz4"
185+
CodecZstdExt = "CodecZstd"
182186
MPIExt = "MPI"
187+
bitshuffle_jll_ext = "bitshuffle_jll"
183188

184189
[[deps.HDF5_jll]]
185190
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"]

docs/make.jl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,34 @@ using H5Zblosc
44
using H5Zbzip2
55
using H5Zlz4
66
using H5Zzstd
7+
using H5Zbitshuffle
78
using MPI # needed to generate docs for parallel HDF5 API
89

10+
# Load extension packages
11+
const BloscExt = Base.get_extension(HDF5, :BloscExt)
12+
const bitshuffle_jll_ext = Base.get_extension(HDF5, :bitshuffle_jll_ext)
13+
const BloscExt = Base.get_extension(HDF5, :BloscExt)
14+
const CodecBzip2Ext = Base.get_extension(HDF5, :CodecBzip2Ext)
15+
const CodecLz4Ext = Base.get_extension(HDF5, :CodecLz4Ext)
16+
const CodecZstdExt = Base.get_extension(HDF5, :CodecZstdExt)
17+
918
DocMeta.setdocmeta!(HDF5, :DocTestSetup, :(using HDF5); recursive=true)
1019

1120
makedocs(;
1221
sitename="HDF5.jl",
13-
modules=[HDF5, H5Zblosc, H5Zbzip2, H5Zlz4, H5Zzstd],
22+
modules=[
23+
HDF5,
24+
H5Zblosc,
25+
H5Zbzip2,
26+
H5Zlz4,
27+
H5Zzstd,
28+
H5Zbitshuffle,
29+
bitshuffle_jll_ext,
30+
BloscExt,
31+
CodecBzip2Ext,
32+
CodecLz4Ext,
33+
CodecZstdExt
34+
],
1435
authors="Mustafa Mohamad <mus-m@outlook.com> and contributors",
1536
format=Documenter.HTML(;
1637
prettyurls=get(ENV, "CI", "false") == "true",

docs/src/interface/filters.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,29 @@ Several external Julia packages implement HDF5 filter plugins in Julia.
3939
As they are independent of HDF5.jl, they must be installed in order to use their plugins.
4040

4141
The
42+
[H5Zbitshuffle.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zbitshuffle),
4243
[H5Zblosc.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zblosc),
4344
[H5Zbzip2.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zbzip2),
4445
[H5Zlz4.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zlz4), and
4546
[H5Zzstd.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zzstd) packages are maintained as
4647
independent subdirectory packages within the HDF5.jl repository.
4748

49+
### Extension packages
50+
51+
For Julia 1.9 and greater, the external filter packages listed above at version 0.2 and greater are loose wrappers around extension packages. The filter extension packages currently implemented are as follows:
52+
* bitshuffle_jll_ext
53+
* H5Zblosc_ext
54+
* H5Zbzip2_ext
55+
* H5Zlz4_ext
56+
* H5Zzstd_ext
57+
58+
```
59+
using HDF5, CodecZstd
60+
const CodecZstdExt = Base.get_extension(HDF5, :CodecZstdExt)
61+
using .CodecZstdExt
62+
filter = ZstdFilter(5)
63+
```
64+
4865
### H5Zblosc.jl
4966

5067
```@meta
@@ -83,6 +100,19 @@ CurrentModule = H5Zzstd
83100

84101
```@docs
85102
ZstdFilter
103+
H5Zzstd
104+
```
105+
106+
### H5Zbitshuffle
107+
108+
```@meta
109+
CurrentModule = H5Zbitshuffle
110+
```
111+
112+
```@docs
113+
BitshuffleFilter
114+
H5Zbitshuffle
115+
bitshuffle_jll_ext
86116
```
87117

88118
## Other External Filters

0 commit comments

Comments
 (0)