Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move set_blosc! methods to H5ZBlosc.jl #1167

Merged
merged 9 commits into from
Nov 14, 2024
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
Loading