Skip to content

Commit f8afffb

Browse files
authored
Add h5py compat tests (#46)
1 parent 873dda9 commit f8afffb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

test/CondaPkg.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
[deps]
2+
hdf5plugin = ""
3+
h5py = ""
24
imagecodecs = ""

test/hdf5-compat.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import CodecBzip2
1414
import Blosc
1515
import CodecZstd
1616

17+
using PythonCall
18+
pyimport("hdf5plugin")
19+
h5py = pyimport("h5py")
20+
1721
# Useful links:
1822
# https://support.hdfgroup.org/documentation/index.html
1923
# https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md
@@ -68,6 +72,10 @@ codecs = [
6872
h5_decoded = collect(f["test-data"])
6973
@test h5_decoded == data
7074
end
75+
# Test reading with h5py
76+
f = h5py.File(path, "r")
77+
@test PyArray(f["test-data"][pybuiltins.Ellipsis]) == data
78+
f.close()
7179
end
7280
end
7381
end

0 commit comments

Comments
 (0)