Skip to content

Commit

Permalink
add HDF5 test generator
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Oct 11, 2024
1 parent cdacc29 commit e4b0418
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/generate_hdf5.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using HDF5
using H5Zblosc, H5Zzstd, H5Zlz4
# Generate a random array
A = rand(100,100)

compressors = (;
zstd = (; filters = [ZstdFilter(3)]),
blosc = (; filters = [BloscFilter(; level=9, shuffle=H5Zblosc.BITSHUFFLE, compressor="blosclz")]),
lz4 = (; filters = [Lz4Filter(0)]),
# bitshuffle = (; filters = [BitshuffleFilter(; shuffle=H5Zbitshuffle.NOSHUFFLE)]),
)

for (key, kwargs) in pairs(compressors)
h5open(joinpath("data", "test_$key.h5"), "w") do f
g = create_dataset(f, "A", HDF5.datatype(A), size(A); chunks = (20, 20), kwargs...)
g[:, :] = A
end
end

0 comments on commit e4b0418

Please sign in to comment.