ZFPY

class numcodecs.zfpy.ZFPY(mode=<Mock id='140593833551184'>, tolerance=-1, rate=-1, precision=-1, compression_kwargs=None)[source]

Codec providing compression using zfpy via the Python standard library.

Parameters:
mode : integer

One of the zfpy mode choice, e.g., zfpy.mode_fixed_accuracy.

tolerance : double, optional

A double-precision number, specifying the compression accuracy needed.

rate : double, optional

A double-precision number, specifying the compression rate needed.

precision : int, optional

A integer number, specifying the compression precision needed.

codec_id = 'zfpy'
encode(buf)[source]

Encode data in buf.

Parameters:
buf : buffer-like

Data to be encoded. May be any object supporting the new-style buffer protocol.

Returns:
enc : buffer-like

Encoded data. May be any object supporting the new-style buffer protocol.

decode(buf, out=None)[source]

Decode data in buf.

Parameters:
buf : buffer-like

Encoded data. May be any object supporting the new-style buffer protocol.

out : buffer-like, optional

Writeable buffer to store decoded data. N.B. if provided, this buffer must be exactly the right size to store the decoded data.

Returns:
dec : buffer-like

Decoded data. May be any object supporting the new-style buffer protocol.

get_config()

Return a dictionary holding configuration parameters for this codec. Must include an ‘id’ field with the codec identifier. All values must be compatible with JSON encoding.

classmethod from_config(config)

Instantiate codec from a configuration object.