Numcodecs implementation of WavPack audio codec.
Project description
WavPack - numcodecs implementation
Numcodecs wrapper to the WavPack audio codec.
This implementation enables one to use WavPack as a compressor in Zarr.
Requirements
To install wavpack-numcodecs
on MacOS, you need to install wavpack
with brew
:
brew install wavpack
For Linux and Windows, the package comes with pre-built binaries of the most recent version Wavpack version.
On Linux, if an existing wavpack
installation is found, the package will use it. Otherwise, it will use the pre-built binaries available in the wavpack_numcodecs/libraries
folder.
On Windows, you need to have the "Microsoft C++ Build Tools" installed. You can download it and install it from here.
Installation
Install via pip
:
pip install wavpack-numcodecs
Or from sources:
git clone https://github.com/AllenNeuralDynamics/wavpack-numcodecs.git
cd wavpack_numcodecs
pip install .
Usage
This is a simple example on how to use the WavPackCodec
with zarr
:
from wavpack_numcodecs import WavPack
data = ... # any numpy array
# instantiate WavPack compressor
wv_compressor = WavPack(level=2, bps=None)
z = zarr.array(data, compressor=wv_compressor)
data_read = z[:]
Available **kwargs
can be browsed with: WavPack?
NOTE:
In order to reload in zarr an array saved with the WavPack
, you just need to have the wavpack_numcodecs
package
installed.
Developmers guide
How to upgrade WavPack installation and make a new release
To upgrade the WavPack installation, you need to:
- Download the latest version of WavPack from the official website.
- Extract the content of the downloaded file.
- Create a new folder in the
src/wavpack_numcodecs/libraries
folder with the name of the version of the WavPack you are installing. - Add the Windows .dll and .lib files to the
windows-x86_32
andwindows-x86_64
folders, respectievely. - Update the version of the CI workflows in the
.github/wavpack_latest_version.txt
file and set theLATEST_WAVPACK_VERSION
variable in thesetup.py
to match the version of the WavPack you are installing. - Make a PR with the changes and merge it.
- Manually trigger the
Build wavpack binaries
workflow in the Actions tab of the repository. This will automatically build the binaries for different Linux versions and make PRs with the changes to themain
branch. - Merge the automated PRs to update the Linux binaries.
- Update the version of the package in the
pyproject.toml
file and tag the repo to automatically make a new release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file wavpack-numcodecs-0.2.2.tar.gz
.
File metadata
- Download URL: wavpack-numcodecs-0.2.2.tar.gz
- Upload date:
- Size: 2.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d570c4348cfc335e4e23d09695f6f1b73af2d64bd2c58351642306079131bfb5 |
|
MD5 | 11dd4994631cb26d85584f9800a9f575 |
|
BLAKE2b-256 | 6651c11893dfe0435f4a259d9f62becbe62143204ee9084b895fba397525856e |