API Reference#
API reference for pyvista-zstd.
Convenience Functions#
pyvista-zstd exposes convenience functions to easily read and write compressed
datasets using Zstandard
pyvista_zstd.read() and pyvista_zstd.write() work on files.
A container that is already in memory, rather than on disk, is read with
pyvista_zstd.read_buffer(), and a single array with
pyvista_zstd.read_array(). pyvista_zstd.append_arrays() adds arrays
to an existing file.
|
Decompress a |
|
Decompress a |
|
Read a single array back without full decompression. |
|
Append named arrays to an existing |
|
Compress a PyVista or VTK dataset. |
Classes#
pyvista-zstd also exposes two classes to fine tune how datasets are read and
written. For example, using the pyvista_zstd.Reader, you can select the arrays
you wish to read in or even progressively read in individual datasets from a
pyvista.MultiBlock.
|
Class to control pyvista-zstd file decompression. |
|
Class to write a pyvista-zstd file. |
The reader also describes a file without decompressing its arrays, and reads one array at a time:
with pyvista_zstd.Reader("mesh.pv") as reader:
meta = reader.dataset_metadata # type, sizes, array shapes and dtypes
level = reader.file_metadata.compression_level
stress = reader.read_array("stress", association="cell")
For a pyvista.MultiBlock, index the reader to a block first, as in
reader[0][1].read_array("Normals", association="point").
Metadata#
Returned by pyvista_zstd.Reader.dataset_metadata and
pyvista_zstd.Reader.file_metadata.
|
Metadata of one stored dataset, known without decompressing its arrays. |
|
Metadata of a stored |
|
Shape and dtype of one stored array, known without decompressing it. |
|
File-level facts of a pyvista-zstd container. |