Function py_compress

Source
pub fn py_compress(
    grids: Vec<PyRef<'_, PyGridArray>>,
    metadata: &PyMetaData,
    path: &str,
) -> PyResult<()>
Expand description

Compresses and writes a collection of GridArrays and shared metadata to a file.

Compresses the provided grids and metadata and writes them to the specified file path.

§Parameters

  • grids: The list of grid arrays to compress.
  • metadata: The shared metadata for the grids.
  • path: The output file path.

§Returns

Returns Ok(()) if the compression succeeds, or a PyRuntimeError if the operation fails.

§Errors

Returns a PyRuntimeError if the compression process fails due to invalid input or I/O errors.