pyvista_validation.check.check_finite

Contents

pyvista_validation.check.check_finite#

pyvista_validation.check.check_finite(array: _ArrayLikeOrScalar[NumberType], /, *, name: str = 'Array') None#

Check if an array has finite values, that is, no NaN or Inf values.

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:
ValueError

If the array has any Inf or NaN values.

See also

check_real

Examples

Check if an array’s values are finite.

>>> from pyvista_validation import check_finite
>>> check_finite([1, 2, 3])