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

Add bitinfo codec #503

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
75 changes: 75 additions & 0 deletions .github/workflows/ci-osx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: OSX CI

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Conda
uses: conda-incubator/[email protected]
with:
channels: conda-forge
miniforge-version: latest
python-version: ${{ matrix.python-version }}

- name: Show info about `base` environment
shell: "bash -l {0}"
run: |
conda info
conda config --show-sources
conda list --show-channel-urls

- name: Set up `env`
shell: "bash -l {0}"
run: >
conda create -n env
c-compiler cxx-compiler 'clang>=12.0.1'
python=${{matrix.python-version}} wheel pip

- name: Show info about `env` environment
shell: "bash -l {0}"
run: |
conda list --show-channel-urls -n env

- name: Install numcodecs
shell: "bash -l {0}"
run: |
conda activate env
export DISABLE_NUMCODECS_AVX2=""
python -m pip install -v -e .[test,test_extras,msgpack,zfpy,pcodec]

- name: List installed packages
shell: "bash -l {0}"
run: |
conda activate env
python -m pip list

- name: Run tests
shell: "bash -l {0}"
run: |
conda activate env
pytest -v

- uses: codecov/codecov-action@v3
with:
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
#files: ./coverage1.xml,./coverage2.xml # optional
#flags: unittests # optional
#name: codecov-umbrella # optional
#fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
67 changes: 67 additions & 0 deletions .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Windows CI

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Conda
uses: conda-incubator/[email protected]
with:
channels: conda-forge
miniforge-version: latest
python-version: ${{ matrix.python-version }}

- name: Set up `env`
shell: "bash -l {0}"
run: >
conda create -n env
c-compiler cxx-compiler
python=${{matrix.python-version}} wheel pip

- name: Show info about `env` environment
shell: "bash -l {0}"
run: |
conda list --show-channel-urls -n env

- name: Install numcodecs
shell: "bash -l {0}"
run: |
conda activate env
python -m pip install -v -e .[test,test_extras,msgpack,zfpy,pcodec]

- name: List installed packages
shell: "bash -l {0}"
run: |
conda activate env
python -m pip list

- name: Run tests
shell: "bash -l {0}"
run: |
conda activate env
pytest -v

- uses: codecov/codecov-action@v3
with:
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
#files: ./coverage1.xml,./coverage2.xml # optional
#flags: unittests # optional
#name: codecov-umbrella # optional
#fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,14 @@ jobs:

- uses: codecov/codecov-action@v4
with:
<<<<<<< HEAD:.github/workflows/ci.yaml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
=======
#token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
#files: ./coverage1.xml,./coverage2.xml # optional
#flags: unittests # optional
#name: codecov-umbrella # optional
#fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
>>>>>>> ba38507 (Remove usage example from doctest):.github/workflows/ci-linux.yaml
10 changes: 10 additions & 0 deletions docs/bitinfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PCodec
======

.. automodule:: numcodecs.bitinfo

.. autoclass:: BitInfo

.. autoattribute:: codec_id
.. automethod:: encode
.. automethod:: decode
3 changes: 2 additions & 1 deletion docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Unreleased

Enhancements
~~~~~~~~~~~~

* Add bitinfo codec
By :user:`Timothy Hodson <thodson-usgs>` :pr:`503`.

Fix
~~~
Expand Down
3 changes: 3 additions & 0 deletions numcodecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@

register_codec(Shuffle)

from numcodecs.bitinfo import BitInfo
register_codec(BitInfo)

from numcodecs.bitround import BitRound

register_codec(BitRound)
Expand Down
Loading