# Examples from pyvista.core._validation.validate.validate_arrayN_unsigned
# ========================================================================

# Validate a 1D array with four non-negative integer-like elements.
import numpy as np
from pyvista import _validation
arr = _validation.validate_arrayN_unsigned((1.0, 2.0, 3.0, 4.0))
arr

# Verify that the output data type is integral.
np.issubdtype(arr.dtype, int)

# Scalar 0-dimensional values are automatically reshaped to be 1D.
_validation.validate_arrayN_unsigned(42)

# 2D arrays where the first dimension is unity are automatically
# reshaped to be 1D.
_validation.validate_arrayN_unsigned([[1, 2]])

# Add additional constraints if needed.
_validation.validate_arrayN_unsigned((1, 2, 3), must_be_in_range=[1, 3])

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

