Skip to main content

Numpy wrapper for fpzip algorithm (P. Lindstrom & M. Isenburg, 2006)

Project description

PyPI version

fpzip

fpzip is a compression algorithm supporting lossless and lossy encoding for up to 4 dimensional floating point data. This package contains Python C++ bindings for the fpzip algorithm (version 1.3.0). The version number for this package is independent. Python 3.7+ is supported.

import fpzip
import numpy as np

data = np.array(..., dtype=np.float32) # up to 4d float or double array
# Compress data losslessly, interpreting the underlying buffer in C (default) or F order.
compressed_bytes = fpzip.compress(data, precision=0, order='C') # returns byte string
# Back to 3d or 4d float or double array, decode as C (default) or F order.
data_again = fpzip.decompress(compressed_bytes, order='C') 

Installation

pip Binary Installation

pip install fpzip

If we have a precompiled binary available the above command should just work. However, if you have to compile from sounce, it's unfortunately necessary to install numpy first because of a quirk in the Python installation procedure that won't easily recognize when a numpy installation completes in the same process. There are some hacks, but I haven't gotten them to work.

pip Source Installation

Requires C++ compiler.

pip install numpy
pip install fpzip

Direct Installation

Requires C++ compiler.

$ pip install numpy
$ python setup.py develop

References

Algorithm and C++ code by Peter Lindstrom and Martin Isenburg. Cython interface code by William Silversmith. Check out Dr. Lindstrom's site.

  1. Peter Lindstrom and Martin Isenburg, "Fast and Efficient Compression of Floating-Point Data," IEEE Transactions on Visualization and Computer Graphics, 12(5):1245-1250, September-October 2006, doi:10.1109/TVCG.2006.143.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fpzip-1.2.0.tar.gz (172.8 kB view hashes)

Uploaded source

Built Distributions

fpzip-1.2.0-cp310-cp310-win_amd64.whl (96.4 kB view hashes)

Uploaded cp310

fpzip-1.2.0-cp310-cp310-win32.whl (85.9 kB view hashes)

Uploaded cp310

fpzip-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl (129.0 kB view hashes)

Uploaded cp310

fpzip-1.2.0-cp39-cp39-win_amd64.whl (96.4 kB view hashes)

Uploaded cp39

fpzip-1.2.0-cp39-cp39-win32.whl (85.9 kB view hashes)

Uploaded cp39

fpzip-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl (129.0 kB view hashes)

Uploaded cp39

fpzip-1.2.0-cp38-cp38-win_amd64.whl (96.4 kB view hashes)

Uploaded cp38

fpzip-1.2.0-cp38-cp38-win32.whl (85.9 kB view hashes)

Uploaded cp38

fpzip-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl (126.7 kB view hashes)

Uploaded cp38

fpzip-1.2.0-cp37-cp37m-win_amd64.whl (94.8 kB view hashes)

Uploaded cp37

fpzip-1.2.0-cp37-cp37m-win32.whl (84.2 kB view hashes)

Uploaded cp37

fpzip-1.2.0-cp37-cp37m-macosx_10_9_x86_64.whl (126.7 kB view hashes)

Uploaded cp37

fpzip-1.2.0-cp36-cp36m-win_amd64.whl (94.9 kB view hashes)

Uploaded cp36

fpzip-1.2.0-cp36-cp36m-win32.whl (84.2 kB view hashes)

Uploaded cp36

fpzip-1.2.0-cp36-cp36m-macosx_10_9_x86_64.whl (126.5 kB view hashes)

Uploaded cp36

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page