Skip to content

Commit

Permalink
Convert H5Z*.jl packages into package extensions (#1160)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mkitti authored Nov 14, 2024
1 parent 641aa57 commit 08d030f
Show file tree
Hide file tree
Showing 35 changed files with 1,456 additions and 1,152 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Please also see the [release notes](https://github.com/JuliaIO/HDF5.jl/releases)

## v0.18.0 (in development)
* Refactor Dataspaces (#1104)
* Convert filter packages into package extensions (#1160)

## v0.17.2
* Fix variable length strings as attributes (#1130)
Expand Down
34 changes: 27 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,42 @@ version = "0.17.1"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
HDF5_jll = "0234f1f7-429e-5d53-9886-15a909be8d59"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
Mmap = "a63ad114-7e13-5084-954f-fe012c677804"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"

[weakdeps]
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"

[extensions]
MPIExt = "MPI"

[compat]
Blosc = "0.7.3"
CodecBzip2 = "0.7, 0.8"
CodecLz4 = "0.4"
CodecZstd = "0.7, 0.8"
Compat = "3.1.0, 4"
HDF5_jll = "~1.10.5, ~1.12.0, ~1.14.0"
MPI = "0.20"
MPIPreferences = "0.1.7"
Preferences = "1.3"
Requires = "1.0"
bitshuffle_jll = "0.4.2, 0.5"
julia = "1.6"

[extensions]
BloscExt = "Blosc"
CodecBzip2Ext = "CodecBzip2"
CodecLz4Ext = "CodecLz4"
CodecZstdExt = "CodecZstd"
MPIExt = "MPI"
bitshuffle_jll_ext = "bitshuffle_jll"

[extras]
Blosc = "a74b3585-a348-5f62-a45c-50e91977d574"
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
CodecLz4 = "5ba52731-8f18-5e0d-9241-30f10d1ec561"
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
H5Zblosc = "c8ec2601-a99c-407f-b158-e79c03c2f5f7"
Expand All @@ -42,6 +53,15 @@ MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
bitshuffle_jll = "228fe19c-1b83-5282-a626-13744502a320"

[targets]
test = ["Test", "MPI", "Distributed", "LinearAlgebra", "OrderedCollections", "Pkg", "CRC32c", "FileIO"]

[weakdeps]
Blosc = "a74b3585-a348-5f62-a45c-50e91977d574"
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
CodecLz4 = "5ba52731-8f18-5e0d-9241-30f10d1ec561"
CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
bitshuffle_jll = "228fe19c-1b83-5282-a626-13744502a320"
17 changes: 11 additions & 6 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,41 +145,46 @@ version = "2.46.2+0"
deps = ["HDF5", "bitshuffle_jll"]
path = "../filters/H5Zbitshuffle"
uuid = "51b4e782-877f-4ccf-958a-27bf628210da"
version = "0.1.3"
version = "0.2.0"

[[deps.H5Zblosc]]
deps = ["Blosc", "HDF5"]
path = "../filters/H5Zblosc"
uuid = "c8ec2601-a99c-407f-b158-e79c03c2f5f7"
version = "0.1.2"
version = "0.2.0"

[[deps.H5Zbzip2]]
deps = ["CodecBzip2", "HDF5"]
path = "../filters/H5Zbzip2"
uuid = "094576f2-1e46-4c84-8e32-c46c042eaaa2"
version = "0.1.2"
version = "0.2.0"

[[deps.H5Zlz4]]
deps = ["CodecLz4", "HDF5"]
path = "../filters/H5Zlz4"
uuid = "eb20ec05-5464-47b5-ba41-098e3c1068a3"
version = "0.1.1"
version = "0.2.0"

[[deps.H5Zzstd]]
deps = ["CodecZstd", "HDF5"]
path = "../filters/H5Zzstd"
uuid = "f6f2d980-1ec6-471c-a70d-0270e22f1103"
version = "0.1.2"
version = "0.2.0"

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

[deps.HDF5.extensions]
BloscExt = "Blosc"
CodecBzip2Ext = "CodecBzip2"
CodecLz4Ext = "CodecLz4"
CodecZstdExt = "CodecZstd"
MPIExt = "MPI"
bitshuffle_jll_ext = "bitshuffle_jll"

[[deps.HDF5_jll]]
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"]
Expand Down
23 changes: 22 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,34 @@ using H5Zblosc
using H5Zbzip2
using H5Zlz4
using H5Zzstd
using H5Zbitshuffle
using MPI # needed to generate docs for parallel HDF5 API

# Load extension packages
const BloscExt = Base.get_extension(HDF5, :BloscExt)
const bitshuffle_jll_ext = Base.get_extension(HDF5, :bitshuffle_jll_ext)
const BloscExt = Base.get_extension(HDF5, :BloscExt)
const CodecBzip2Ext = Base.get_extension(HDF5, :CodecBzip2Ext)
const CodecLz4Ext = Base.get_extension(HDF5, :CodecLz4Ext)
const CodecZstdExt = Base.get_extension(HDF5, :CodecZstdExt)

DocMeta.setdocmeta!(HDF5, :DocTestSetup, :(using HDF5); recursive=true)

makedocs(;
sitename="HDF5.jl",
modules=[HDF5, H5Zblosc, H5Zbzip2, H5Zlz4, H5Zzstd],
modules=[
HDF5,
H5Zblosc,
H5Zbzip2,
H5Zlz4,
H5Zzstd,
H5Zbitshuffle,
bitshuffle_jll_ext,
BloscExt,
CodecBzip2Ext,
CodecLz4Ext,
CodecZstdExt
],
authors="Mustafa Mohamad <[email protected]> and contributors",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
Expand Down
30 changes: 30 additions & 0 deletions docs/src/interface/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,29 @@ Several external Julia packages implement HDF5 filter plugins in Julia.
As they are independent of HDF5.jl, they must be installed in order to use their plugins.

The
[H5Zbitshuffle.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zbitshuffle),
[H5Zblosc.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zblosc),
[H5Zbzip2.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zbzip2),
[H5Zlz4.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zlz4), and
[H5Zzstd.jl](https://github.com/JuliaIO/HDF5.jl/tree/master/filters/H5Zzstd) packages are maintained as
independent subdirectory packages within the HDF5.jl repository.

### Extension packages

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:
* bitshuffle_jll_ext
* H5Zblosc_ext
* H5Zbzip2_ext
* H5Zlz4_ext
* H5Zzstd_ext

```
using HDF5, CodecZstd
const CodecZstdExt = Base.get_extension(HDF5, :CodecZstdExt)
using .CodecZstdExt
filter = ZstdFilter(5)
```

### H5Zblosc.jl

```@meta
Expand Down Expand Up @@ -83,6 +100,19 @@ CurrentModule = H5Zzstd

```@docs
ZstdFilter
H5Zzstd
```

### H5Zbitshuffle

```@meta
CurrentModule = H5Zbitshuffle
```

```@docs
BitshuffleFilter
H5Zbitshuffle
bitshuffle_jll_ext
```

## Other External Filters
Expand Down
Loading

0 comments on commit 08d030f

Please sign in to comment.