Skip to main content

A python wrapper for the ZFP compression libary

Project description

pyzfp

Python wrapper over the zfp compression library. This is the second version, rewritten using Cython because the earlier version using ctypes was slow. Click here for performance comparison. Currently wraps zfp version 0.5.5.

Installation

pip install pyzfp

This should download zfp version 0.5.5, compile it and install the python (Cython) wrappers in the default install location. The use of a virtual environment is recommended.

Should you face any issues, please report them using Github issues.

Usage

A sample program that demonstrates the use of the library: (also contents of test.py):

from pyzfp import compress, decompress


a = np.linspace(0, 100, num=1000000).reshape((100, 100, 100))



tolerance = 0.0000001
parallel = True
compressed = compress(a, tolerance=tolerance, parallel=parallel)

recovered = decompress(compressed, a.shape, a.dtype, tolerance=tolerance)
print(len(a.tostring()))
print(len(compressed))
print(np.linalg.norm(recovered-a))

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

pyzfp-0.5.5.tar.gz (257.6 kB view details)

Uploaded Source

File details

Details for the file pyzfp-0.5.5.tar.gz.

File metadata

  • Download URL: pyzfp-0.5.5.tar.gz
  • Upload date:
  • Size: 257.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for pyzfp-0.5.5.tar.gz
Algorithm Hash digest
SHA256 530aacd023e377c36741f07a4f9079a6d997fa94fc5fe05326894a88b8b65bf3
MD5 e6ae3276164ba79877645859d765bb12
BLAKE2b-256 ca56b736d3e9aa9bbcca7efcb17f7ff24745b5c75f8d1505760bc21440ec4241

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page