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

Fix lzf_filter compatibility with HDF5 > 1.8 #155

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@ jobs:

strategy:
matrix:
python-version: ["3.6", "3.7", "3.10"]
python-version: ["3.9", "3.10", "3.12"]
os: [ubuntu-latest, macos-latest]
exclude:
- os: macos-latest
python-version: "3.6"

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install apt dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-serial-dev hdf5-tools pkg-config

- name: Install homebrew dependencies
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew update
brew install hdf5 pkg-config

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
hdf5: ["1.10.7"]
hdf5: ["1.10.7", "1.14.4"]

steps:
# Checkout bitshuffle
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Build wheels for linux and x86 platforms
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.19.2
with:
output-dir: ./wheelhouse-hdf5-${{ matrix.hdf5}}
env:
Expand Down Expand Up @@ -57,18 +57,18 @@ jobs:
name: Build source distribution
strategy:
matrix:
python-version: ["3.8"]
python-version: ["3.9"]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install apt dependencies
run: |
sudo apt-get install -y libhdf5-serial-dev hdf5-tools pkg-config

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
14 changes: 9 additions & 5 deletions lzf/lzf_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,22 @@
#endif

/* Deal with the mutiple definitions for H5Z_class_t.
Note: Only HDF5 1.6 and 1.8 are supported.
Note: HDF5 1.6 and >= 1.8 are supported.
See https://portal.hdfgroup.org/hdf5/develop/group___h5_z.html#title6
for version history.

(1) The old class should always be used for HDF5 1.6
(2) The new class should always be used for HDF5 1.8 < 1.8.3
(3) The old class should be used for HDF5 1.8 >= 1.8.3 only if the
(3) The old class should be used for HDF5 >= 1.8.3 only if the
macro H5_USE_16_API is set
*/

#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8 && (H5_VERS_RELEASE < 3 || !H5_USE_16_API)
#define H5PY_H5Z_NEWCLS 1
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR < 8
#define H5PY_H5Z_NEWCLS 0
#elif H5_VERS_MAJOR == 1 && H5_VERS_MINOR >= 8 && H5_VERS_RELEASE >= 3 && H5_USE_16_API
#define H5PY_H5Z_NEWCLS 0
#else
#define H5PY_H5Z_NEWCLS 0
#define H5PY_H5Z_NEWCLS 1
#endif

size_t lzf_filter(unsigned flags, size_t cd_nelmts,
Expand Down