pyvista_zstd.read_array

Contents

pyvista_zstd.read_array#

pyvista_zstd.read_array(filename: Path | str, name: str, *, association: Association = 'field', backend: str | None = None) → NDArray#

Read a single array back without full decompression.

Decompresses exactly the two frames of the named block - the rest of the file is never decompressed, so this stays cheap even on a multi-gigabyte container. Arrays of a MultiBlock’s blocks are read with pyvista_zstd.Reader.read_array() after indexing to the block. A MultiBlock’s own field arrays can be read directly.

Parameters:
filenamepathlib.Path | str

Path to a .pv file.

namestr

Array name. For field data this is the key passed to append_arrays() or any field-data key in the file.

association{“field”, “point”, “cell”}, default: “field”

Data the array belongs to.

backendstr, optional

Deprecated and ignored; passing it raises a DeprecationWarning.

Returns:
numpy.ndarray

The stored array, bit-exact.

Raises:
KeyError

The file has no such array.

TypeError

The file is a MultiBlock and association is "point" or "cell".

ValueError

association is not "field", "point" or "cell".