SChunk#

The basic compressed data container (aka super-chunk). This class consists of a set of useful parameters and methods that allow not only to create compressed data, and decompress it, but also to manage the data in a more sophisticated way. For example, it is possible to append new data, update existing data, delete data, etc.

Methods#

SChunk.__init__

Create a new super-chunk, or open an existing one.

SChunk.append_data

Append a data buffer to the SChunk.

SChunk.decompress_chunk

Decompress the chunk given by its index nchunk.

SChunk.delete_chunk

Delete the specified chunk from the SChunk.

SChunk.get_chunk

Return the compressed chunk that is in the SChunk.

SChunk.insert_chunk

Insert an already compressed chunk into the SChunk.

SChunk.insert_data

Insert the data in the specified position in the SChunk.

SChunk.iterchunks

Iterate over the self chunks of the SChunk.

SChunk.iterchunks_info

Iterate over the chunks of the SChunk, providing info on index and special values.

SChunk.fill_special

Fill the SChunk with a special value.

SChunk.update_chunk

Update an existing chunk in the SChunk.

SChunk.update_data

Update the chunk in the specified position with the given data.

SChunk.get_slice

Get a slice from start to stop.

SChunk.__getitem__

Get a slice from the SChunk.

SChunk.__setitem__

Set slice to value.

SChunk.__len__

Return the number of items in the SChunk.

SChunk.to_cframe

Get a bytes object containing the serialized SChunk instance.

SChunk.postfilter

Decorator to set a function as a postfilter.

SChunk.remove_postfilter

Remove the postfilter from the SChunk instance.

SChunk.filler

Decorator to set a filler function.

SChunk.prefilter

Decorator to set a function as a prefilter.

SChunk.remove_prefilter

Remove the prefilter from the SChunk instance.

Attributes#

SChunk.blocksize

The block size (in bytes).

SChunk.cbytes

Amount of compressed data bytes (data size + chunk headers size).

SChunk.chunkshape

Number of elements per chunk.

SChunk.chunksize

Number of bytes in each chunk.

SChunk.contiguous

Whether the SChunk is stored contiguously or sparsely.

SChunk.cparams

blosc2.CParams instance with the compression parameters.

SChunk.cratio

Compression ratio.

SChunk.dparams

blosc2.DParams instance with the decompression parameters.

SChunk.meta

Access to the fixed-length metadata of the SChunk.

SChunk.nbytes

Amount of uncompressed data bytes.

SChunk.typesize

Type size of the SChunk.

SChunk.urlpath

Path where the SChunk is stored.

SChunk.vlmeta

Access to the variable-length metadata of the SChunk.

Functions#

schunk_from_cframe(cframe[, copy])

Create a SChunk instance from a contiguous frame buffer.