pyvista.core._validation.check.check_less_than#
- check_less_than(
- array: _ArrayLikeOrScalar[NumberType],
- /,
- value: float,
- *,
- strict: bool = True,
- name: str = 'Array',
Check if an array’s elements are all less than some value.
- Parameters:
- array
float|ArrayLike[float] Number or array to check.
- value
float Value which the array’s elements must be less than.
- strictbool, default:
True If
True, the array’s value must be strictly less thanvalue. Otherwise, values must be less than or equal tovalue.- name
str, default: “Array” Variable name to use in the error messages if any are raised.
- array
- Raises:
ValueErrorIf 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 import _validation >>> _validation.check_less_than([-1, -2, -3], value=0)