Repository navigation
Add trpx filter #413
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
base: main
Are you sure you want to change the base?
Add trpx filter #413
Changes from all commits
264fabf
e754523
64a572b
4c30043
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,6 +83,8 @@ HDF5 compression filters and compression libraries sources were obtained from: | |
| * `SZ3 plugin <https://github.com/szcompressor/SZ3>`_ | ||
| (commit `4bbe9df7e4bcb <https://github.com/szcompressor/SZ3/commit/4bbe9df7e4bcb6ae6339fcb3033100da07fe7434>`_) | ||
| using `SZ3 <https://github.com/szcompressor/SZ3>`_ and ZStd. | ||
| * `TERSE/PROLIX (TRPX v2.0) plugin <https://github.com/senikm/trpx2.0>`_ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The hdf5 registered filters list points to the https://github.com/Senikm/trpx repo rather than trpx2.0. It would be best to see with upstream and the hdf group to update the link to the new repo. This projects aims at embedding official versions of the different filters. Does trpx2.0 reads data compressed with trpx? If it is not the case, this should be advertised in the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, the library is meant to also read trpx v1 files but i found a small bug and created a merge request for that in their repo: senikm/trpx2.0#12 i've also asked them by email to update the link to trpx2.0 |
||
| (commit `93cf8e4 <https://github.com/senikm/trpx2.0/tree/93cf8e4b7e832da3e318e9d37d73f70e3ce08eeb>`_). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind checking with upstream if they can tag a version rather than referencing a commit hash?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i've send a request to the upstream authors by email! |
||
| * `HDF5-ZFP plugin <https://github.com/LLNL/H5Z-ZFP>`_ (v1.1.1) using ZFP. | ||
| * `ZStd plugin <https://github.com/HDFGroup/hdf5_plugins/tree/master/ZSTD>`_ | ||
| (commit `5573db8 <https://github.com/HDFGroup/hdf5_plugins/tree/5573db8f9706e1df262752a9247e90a3d4bd57bd/ZSTD>`_) using ZStd. | ||
|
|
@@ -120,6 +122,7 @@ Please read the different licenses: | |
| * SPERR: `lib/H5Z-SPERR/LICENSE <https://github.com/silx-kit/hdf5plugin/blob/main/lib/H5Z-SPERR/LICENSE>`_ and `lib/SPERR/LICENSE <https://github.com/silx-kit/hdf5plugin/blob/main/lib/SPERR/LICENSE>`_ | ||
| * SZ: `lib/SZ/copyright-and-BSD-license.txt <https://github.com/silx-kit/hdf5plugin/blob/main/lib/SZ/copyright-and-BSD-license.txt>`_ | ||
| * SZ3: `lib/SZ3/copyright-and-BSD-license.txt <https://github.com/silx-kit/hdf5plugin/blob/main/lib/SZ3/copyright-and-BSD-license.txt>`_ | ||
| * TERSE/PROLIX: `lib/trpx2.0/LICENSE <https://github.com/silx-kit/hdf5plugin/blob/main/lib/trpx2.0/LICENSE>`_ | ||
| * zfp: `lib/H5Z-ZFP/LICENSE <https://github.com/silx-kit/hdf5plugin/blob/main/lib/H5Z-ZFP/LICENSE>`_ | ||
| * zstd: `lib/HDF5Plugin-Zstandard/LICENSE <https://github.com/silx-kit/hdf5plugin/blob/main/lib/HDF5Plugin-Zstandard/LICENSE>`_ | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: AddressSanitizer | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| # Builds the pyterse extension with AddressSanitizer and UBSan and runs the | ||
| # Python tests against it. | ||
| pyterse-asan: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| run: python -m pip install --upgrade pip numpy pybind11 | ||
| - name: Configure | ||
| run: > | ||
| cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
| -DBUILD_TERSECODEC=OFF | ||
| -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer -g" | ||
| -DPython_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')" | ||
| -Dpybind11_DIR="$(python -m pybind11 --cmakedir)" | ||
| - name: Build | ||
| run: cmake --build build | ||
| - name: Test | ||
| # The Python interpreter is not instrumented, so the ASan runtime has to be preloaded. | ||
| # libstdc++ is preloaded as well so that ASan can intercept __cxa_throw, which | ||
| # Python itself does not link. | ||
| # Leak detection is off because CPython and NumPy report leaks at exit. | ||
| env: | ||
| ASAN_OPTIONS: detect_leaks=0:abort_on_error=1 | ||
| UBSAN_OPTIONS: print_stacktrace=1 | ||
| run: | | ||
| export LD_PRELOAD="$(gcc -print-file-name=libasan.so) $(gcc -print-file-name=libstdc++.so)" | ||
| export PYTHONPATH="$PWD/build/pyterse" | ||
| python py_tests/pyterse_test.py -v |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Build | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| # Builds tests/build_test.cpp with the compilers of the runner images and | ||
| # runs it. | ||
| posix: | ||
| name: ${{ matrix.os }} ${{ matrix.cxx }} ${{ matrix.flags }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - { os: ubuntu-22.04, cxx: g++-11 } | ||
| - { os: ubuntu-22.04, cxx: g++-12 } | ||
| - { os: ubuntu-22.04, cxx: clang++-13 } | ||
| - { os: ubuntu-22.04, cxx: clang++-14 } | ||
| - { os: ubuntu-22.04, cxx: clang++-15 } | ||
| - { os: ubuntu-24.04, cxx: g++-13 } | ||
| - { os: ubuntu-24.04, cxx: g++-14 } | ||
| - { os: ubuntu-24.04, cxx: clang++-16 } | ||
| - { os: ubuntu-24.04, cxx: clang++-17 } | ||
| - { os: ubuntu-24.04, cxx: clang++-18 } | ||
| - { os: ubuntu-24.04, cxx: clang++-18, flags: -stdlib=libc++, packages: libc++-18-dev libc++abi-18-dev } | ||
| - { os: macos-26, cxx: clang++ } | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| - name: Install packages | ||
| if: matrix.packages | ||
| run: sudo apt-get update && sudo apt-get install -y ${{ matrix.packages }} | ||
| - name: Build | ||
| run: ${{ matrix.cxx }} --version && ${{ matrix.cxx }} -std=c++20 -Wall -Wextra -Werror -pthread ${{ matrix.flags }} -I include tests/build_test.cpp -o build_test | ||
| - name: Test | ||
| run: ./build_test | ||
|
|
||
| windows: | ||
| name: ${{ matrix.os }} MSVC | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [windows-2022, windows-2025] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| # Sets up MSVC with vcvars64.bat of the Visual Studio found by vswhere. | ||
| - name: Build | ||
| shell: cmd | ||
| run: | | ||
| for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do call "%%i\VC\Auxiliary\Build\vcvars64.bat" || exit /b 1 | ||
| cl /std:c++20 /permissive- /EHsc /W4 /WX /I include tests\build_test.cpp | ||
| - name: Test | ||
| run: .\build_test.exe |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Python | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| # Builds the pyterse extension for each Python version and runs py_tests/pyterse_test.py. | ||
| pyterse: | ||
| name: ${{ matrix.os }} Python ${{ matrix.python }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest] | ||
| python: ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| runs-on: ${{ matrix.os }} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python }} | ||
| - name: Install dependencies | ||
| run: python -m pip install --upgrade pip numpy pybind11 | ||
| - name: Configure | ||
| run: > | ||
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | ||
| -DBUILD_TERSECODEC=OFF | ||
| -DPython_EXECUTABLE="$(python -c 'import sys; print(sys.executable)')" | ||
| -Dpybind11_DIR="$(python -m pybind11 --cmakedir)" | ||
| - name: Build | ||
| run: cmake --build build --config Release | ||
| - name: Test | ||
| # Multi-config generators (Visual Studio) put the module in a Release subdirectory. | ||
| run: | | ||
| export PYTHONPATH="$PWD/build/pyterse/Release:$PWD/build/pyterse" | ||
| python py_tests/pyterse_test.py -v |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .DS_Store | ||
| .vscode/ | ||
| build/ | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| cmake_minimum_required(VERSION 3.15) | ||
| project(pyterse_and_tersecodec LANGUAGES CXX) | ||
|
|
||
|
|
||
| option(BUILD_PYTERSE "Build the pyterse Python extension" ON) | ||
| option(BUILD_TERSECODEC "Build the HDF5 filter library (tersecodec) plugin" ON) | ||
|
|
||
|
|
||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| if(NOT CMAKE_BUILD_TYPE) | ||
| set(CMAKE_BUILD_TYPE Release) | ||
| endif() | ||
|
|
||
|
|
||
| if(BUILD_PYTERSE) | ||
| add_subdirectory(pyterse) | ||
| endif() | ||
|
|
||
| if(BUILD_TERSECODEC) | ||
| add_subdirectory(tersecodec) | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use the class name as filter name in the filter lists: