pyvista.core._validation.check

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(container, /, must_contain, *)

Check if an item is in a container.

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

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

check_greater_than(array, /, 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(array, /, *[, 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(sized_input, /[, exact_length, ...])

Check if the length of an array meets specific requirements.

check_less_than(array, /, value, *[, ...])

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

check_ndim(array, /, ndim, *[, name])

Check if an array has the specified number of dimensions.

check_nonnegative(array, /, *[, 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(array, /, rng, *[, ...])

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(array, /, 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.