pyvista.core._validation.check.check_greater_than

pyvista.core._validation.check.check_greater_than#

check_greater_than(
array: _ArrayLikeOrScalar[NumberType],
/,
value: float,
*,
strict: bool = True,
name: str = 'Array',
) None[source]#

Check if an array’s elements are all greater than some value.

Parameters:
arrayfloat | ArrayLike[float]

Number or array to check.

valuefloat

Value which the array’s elements must be greater than.

strictbool, default: True

If True, the array’s value must be strictly greater than value. Otherwise, values must be greater than or equal to value.

namestr, default: “Array”

Variable name to use in the error messages if any are raised.

Raises:
ValueError

If not all array elements are greater than (or equal to if strict=True) the specified value.

Examples

Check if an array’s values are greater than 0.

>>> from pyvista import _validation
>>> _validation.check_greater_than([1, 2, 3], value=0)