Skip to content
ethcocoderPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parapack

Parapack is an experimental chunked compressor. The lossless integer path evaluates raw, delta, second-delta, frame-of-reference, and dictionary representations. A bounded-error floating-point path applies an orthonormal DCT, quantizes coefficients, and patches samples that exceed the requested absolute error. Both paths use Zstandard and the checksummed chunk-indexed container.

This is a research prototype, not evidence that adaptive views outperform specialized codecs. The integer path supports one-dimensional signed NumPy integer arrays. The lossy path supports one-dimensional finite float32 and float64 arrays with a verified maximum absolute reconstruction error. Adaptive chunk boundaries, learned selection, and the benchmark suite remain future work.

Install

python -m pip install -e .

Use

import numpy as np
from parapack import compress, decompress, decompress_chunk

values = np.array([10, 11, 12, 12, 13, 14], dtype=np.int64)
packed = compress(values, chunk_size=3)
restored = decompress(packed)
first_chunk = decompress_chunk(packed, 0)
assert np.array_equal(restored, values)

For floating-point data, max_abs_error is a strict L-infinity bound. If a DCT representation cannot meet the bound safely or compresses worse than raw data, Parapack falls back to exact chunk storage.

from parapack import compress_lossy, decompress

signal = np.sin(np.linspace(0, 8 * np.pi, 4096)).astype(np.float32)
packed = compress_lossy(signal, max_abs_error=1e-3, chunk_size=512)
restored = decompress(packed)
assert np.max(np.abs(signal - restored)) <= 1e-3

Run the test suite with:

python -m unittest discover -s tests -v

No compression-ratio or throughput claims are made yet. The next design steps are adaptive chunking, cost-model calibration, and reproducible comparisons against suitable specialized baselines.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages