pyvista_validation.check.check_real#
- pyvista_validation.check.check_real(array, *, name='Array')#
Check if an array has real numbers (float or integer type).
- Parameters:
- arrayfloat | ArrayLikeFloat
Number or array to check.
- namestr, default: “Array”
Variable name to use in the error messages if any are raised.
- Returns:
- array_like
The input, unchanged.
- 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 and text 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]) [1, 2, 3]