Skip to content

Commit

Permalink
Move set_blosc! methods to H5ZBlosc.jl (#1167)
Browse files Browse the repository at this point in the history
* Move `set_blosc!` methods to H5ZBlosc.jl

As far as I can tell, this usage of Requires was entirely unnecessary
since the package it was "extending" already depends on HDF5.jl

Co-authored-by: Gabriel Baraldi <[email protected]>

* Bump `docs` Manifest.toml

This is needed to pick up Documenter 1.4.0 which supports
fully-qualified `@ref` links.

* Fix downstream CI to dev filter packages

* Bump `H5Zblosc` version number and add compat bound

* Remove H5Zblosc `[compat]` bound

There's already an HDF5 compat bound in H5Zblosc - that one just needs
to be kept up-to-date.

* Move code to BloscExt rather H5Zblosc, reconcile other changes

* Refer to BloscExt.BloscFilter rather than H5Zblosc.BloscFilter

* Remove Julia 1.6 references from CI.yml

---------

Co-authored-by: Gabriel Baraldi <[email protected]>
Co-authored-by: Mark Kittisopikul <[email protected]>
Co-authored-by: Mark Kittisopikul <[email protected]>
  • Loading branch information
4 people authored Nov 14, 2024
1 parent 038f96c commit 1a24872
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
strategy:
matrix:
version:
- '1.6'
- '1.9'
- '1.10'
- '1'
os:
- ubuntu-20.04 # required for libhdf5 v1.10.4 support
Expand Down Expand Up @@ -50,9 +51,9 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.9'
- '1.10'
- '1'
- '1.11-nightly'
- 'nightly'
os:
- ubuntu-latest
Expand All @@ -66,14 +67,8 @@ jobs:
arch: x86
- os: ubuntu-latest # excluded because HDF5_jll v1.12 does not support i686
arch: x86
- version: '1.6'
arch: x86
- version: 'nightly'
arch: x86
- version: '1.6'
os: macOS-latest
- version: '1.6'
os: windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
Expand Down Expand Up @@ -123,7 +118,14 @@ jobs:
using Pkg
try
# force it to use this PR's version of the package
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
Pkg.develop(PackageSpec[ # resolver may fail with main deps
PackageSpec(path="."),
PackageSpec(path="./filters/H5Zbitshuffle"),
PackageSpec(path="./filters/H5Zblosc"),
PackageSpec(path="./filters/H5Zbzip2"),
PackageSpec(path="./filters/H5Zlz4"),
PackageSpec(path="./filters/H5Zzstd"),
])
Pkg.update()
Pkg.test() # resolver may fail with test time deps
catch err
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MPIPreferences = "0.1.7"
Preferences = "1.3"
Requires = "1.0"
bitshuffle_jll = "0.4.2, 0.5"
julia = "1.6"
julia = "1.9"

[extensions]
BloscExt = "Blosc"
Expand Down
7 changes: 7 additions & 0 deletions ext/BloscExt/BloscExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import HDF5.Filters:
set_local_func,
set_local_cfunc
import HDF5.Filters.Shuffle
import HDF5: Properties
import HDF5: set_blosc!

export H5Z_FILTER_BLOSC, blosc_filter, BloscFilter

Expand Down Expand Up @@ -216,6 +218,11 @@ function Base.push!(f::FilterPipeline, blosc::BloscFilter)
return f
end

# legacy support
set_blosc!(p::Properties, val::Bool) = val && push!(FilterPipeline(p), BloscFilter())
set_blosc!(p::Properties, level::Integer) =
push!(FilterPipeline(p), BloscFilter(; level=level))

function __init__()
register_filter(BloscFilter)
end
Expand Down
7 changes: 0 additions & 7 deletions src/HDF5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@ function __init__()
)
end

@require H5Zblosc = "c8ec2601-a99c-407f-b158-e79c03c2f5f7" begin
set_blosc!(p::Properties, val::Bool) =
val && push!(Filters.FilterPipeline(p), H5Zblosc.BloscFilter())
set_blosc!(p::Properties, level::Integer) =
push!(Filters.FilterPipeline(p), H5Zblosc.BloscFilter(; level=level))
end

return nothing
end

Expand Down
2 changes: 1 addition & 1 deletion src/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ Properties used when creating a new `Dataset`. Inherits from
The following options are shortcuts for the various filters, and are set-only.
They will be appended to the filter pipeline in the order in which they appear
- `blosc = true | level`: set the [`H5Zblosc.BloscFilter`](@ref) compression
- `blosc = true | level`: set the [`BloscExt.BloscFilter`](@ref) compression
filter; argument can be either `true`, or the compression level.
- `deflate = true | level`: set the [`Filters.Deflate`](@ref) compression
Expand Down

0 comments on commit 1a24872

Please sign in to comment.