pyvista.core._validation.check#

Functions that check the type and/or value of inputs.

Added in version 0.43.0.

A check function typically:

  • Performs a simple validation on a single input variable.

  • Raises an error if the check fails due to invalid input.

  • Does not modify input or return anything.

Functions

check_contains(*, item, container[, name])

Check if an item is in a container.

check_finite(arr, /, *[, name])

Check if an array has finite values, i.e. no NaN or Inf values.

check_greater_than(arr, /, value, *[, ...])

Check if an array's elements are all greater than some value.

check_instance(obj, /, classinfo, *[, ...])

Check if an object is an instance of the given type or types.

check_integer(arr, /, *[, strict, name])

Check if an array has integer or integer-like float values.

check_iterable(obj, /, *[, name])

Check if an object is an instance of Iterable.

check_iterable_items(iterable_obj, /, ...[, ...])

Check if an iterable's items all have a specified type.

check_length(arr, /, *[, exact_length, ...])

Check if the length of an array meets specific requirements.

check_less_than(arr, /, value, *[, strict, name])

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

check_nonnegative(arr, /, *[, name])

Check if an array's elements are all nonnegative.

check_number(num, /, *[, name])

Check if an object is an instance of Number.

check_range(arr, /, rng, *[, strict_lower, ...])

Check if an array's values are all within a specific range.

check_real(array, /, *[, name])

Check if an array has real numbers, i.e. float or integer type.

check_sequence(obj, /, *[, name])

Check if an object is an instance of Sequence.

check_shape(arr, /, shape, *[, name])

Check if an array has the specified shape.

check_sorted(array, /, *[, ascending, ...])

Check if an array's values are sorted.

check_string(obj, /, *[, allow_subclass, name])

Check if an object is an instance of str.

check_subdtype(input_obj, /, base_dtype, *)

Check if an input's data-type is a subtype of another data-type(s).

check_type(obj, /, classinfo, *[, name])

Check if an object is one of the given type or types.