Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 2.31 KB

File metadata and controls

56 lines (40 loc) · 2.31 KB

pytest documentation

pycompressor

Fast and efficient python implementation of PDF compression (https://arxiv.org/abs/1504.06469).

How to install

To install pyCompressor, just type:

python setup.py install # or python setup.py develop (if you want development mode)

How to use

Standard compression

The input parameters that define the compression is contained in a YAML file. To run the standard compression, use the reference runcard as it is by just replacing the entry of the pdf key with the name of the PDF set, then run the following:

pycomp runcards/runcard.yml [--threads NUMB_THREADS]

Using GAN and/or Compressing from an enhanced set

Although it is advised to run the ganpdfs independently, it is possible to generate enhanced PDF replicas within the pycompressor. To do so, just set the entry enhance in the runcard to True and specify the total number of replicas (prior+synthetics).

Finally, in order to perform a compression with an enhanced set, set the entry existing_enhanced to True.

A detailed instruction on how to set the different parameters in the runcard can be found here.

Generating compressed PDF set & post-analysis

The code will create a folder named after the prior PDF sets. To generate the compressed PDF grid, run the following command:

get-grid -i <PDF_NAME>/compressed_<PDF_NAME>_<NB_COMPRESSED>_output.dat

Note that if the compression is done from an enhanced set, the output folder will be appended by _enhanced.

Finally, in order to generate ERF plots, enter in the erfs_output directory and run the following:

validate --random erf_randomized.dat --reduced erf_reduced.dat

This script can also plot the ERF validation from the old compressor code by adding the flag --format ccomp.

Warning

This package cannot be installed with python 3.9 yet due to the numba dependency. This will be resolved soon according to #6579.