This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / cluster / hierarchy / _hierarchy_impl / _lazy_valid_checks

function

scipy.cluster.hierarchy._hierarchy_impl:_lazy_valid_checks

source: build-install/usr/lib/python3.14/site-packages/scipy/cluster/hierarchy/_hierarchy_impl.py:2274

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._hierarchy_impl._lazy_valid_checks