pyvista-validation#
Validate and standardize array-like input.
These are the input validation functions developed for PyVista, extracted into a standalone package so
any project can use them. Input validation methods can be used for checking
and/or validating that a variable has the correct type and/or value for use by
an algorithm. They are useful when writing custom Python methods that accept
flexible array-like input, wrapping VTK, and/or when Contributing to
PyVista.
Installation#
pip install pyvista-validation
NumPy is the only required dependency. VTK and SciPy are only needed
to validate their own object types, so they ship as extras:
pip install pyvista-validation[vtk] # accept vtkMatrix3x3, vtkMatrix4x4, vtkTransform
pip install pyvista-validation[scipy] # accept scipy.spatial.transform.Rotation
pip install pyvista-validation[all] # both
Neither is imported unless one of their objects is actually passed in.
Common use cases#
- Validate a 3-element vector:
- Validate an Nx3 point or vector array:
- Validate point or cell IDs:
- Validate a transformation matrix: