pyvista_validation.check.check_real#
- pyvista_validation.check.check_real(array: _ArrayLikeOrScalar[NumberType], /, *, name: str = 'Array') None#
Check if an array has real numbers (float or integer type).
- Parameters:
- arrayfloat | ArrayLike[float]
Number or array to check.
- namestr, default: “Array”
Variable name to use in the error messages if any are raised.
- Raises:
- TypeError
If the array does not have real numbers.
See also
check_integerSimilar function for integer arrays.
check_numberSimilar function for scalar values.
check_finiteCheck for finite values.
Notes
Boolean data types are not considered real and will raise an error.
Arrays with
infinityorNaNvalues are considered real and will not raise an error. Usecheck_finite()to check for finite values.
Examples
Check if an array has real numbers.
>>> from pyvista_validation import check_real >>> check_real([1, 2, 3])