{ } Raw JSON

bundles / scipy 1.17.1 / scipy / cluster / hierarchy / _lazy_valid_checks

function

scipy.cluster.hierarchy:_lazy_valid_checks

source: /scipy/cluster/hierarchy.py :2364

Signature

def   _lazy_valid_checks ( * args throw = False warning = False materialize = False xp )

Summary

Validate a set of conditions on the contents of possibly lazy arrays.

Parameters

args : tuples of (Array, str)

The first element of each tuple must be a 0-dimensional Array that evaluates to bool; the second element must be the message to convey if the first element evaluates to True.

throw: bool

Set to True to raise ValueError(args[i][1]) if args[i][0] is True.

warning: bool

Set to True to issue a warning with message args[i][1] if args[i][0] is True.

materialize: bool

Set to True to force materialization of lazy arrays when throw=True or warning=True. If the inputs are lazy and materialize=False, ignore the throw and warning flags.

xp: module

Array API namespace

Returns

: If xp is an eager backend (e.g. numpy) and all conditions are False, return True.
: If throw is True, raise. Otherwise, return False.
: If xp is a lazy backend (e.g. Dask or JAX), return a 0-dimensional bool Array.

Aliases

  • scipy.cluster.hierarchy._lazy_valid_checks