pyvista_validation.check.check_less_than

pyvista_validation.check.check_less_than#

pyvista_validation.check.check_less_than(array, /, value, *, strict=True, name='Array')#

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

Parameters:
arrayfloat | ArrayLikeFloat

Number or array to check.

valuefloat

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

strictbool, default: True

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

namestr, default: “Array”

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

Returns:
array_like

The input, unchanged.

Raises:
ValueError

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

Examples

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

>>> from pyvista_validation import check_less_than
>>> check_less_than([-1, -2, -3], value=0)
[-1, -2, -3]