testing.assert_less¶
- array_api_extra.testing.assert_less(x, y, *, err_msg='', verbose=True, check_dtype=True, check_shape=True, check_scalar=False, xp=None)¶
Check that two arrays are ordered by less than.
This is an interface to
numpy.testing.assert_array_less()which accepts any standard-compatible array and performs additional array namespace, shape, and dtype checks.- Parameters:
x (
object) – Array to compare according tox < y(elementwise).y (
object) – Array to compare according tox < y(elementwise).err_msg (
str) – Error message to display on failure.verbose (
bool) – Whether to include the conflicting arrays in the error message on failure.check_dtype (
bool) – Whether to check agreement between the dtypes of x and y.check_shape (
bool) – Whether to check agreement between the shapes of x and y.check_scalar (
bool) – NumPy only: whether to check agreement between actual and desired types — 0-Dnumpy.ndarrayvs scalar (e.g.numpy.double).xp (
ModuleType|None) – A standard-compatible namespace which x and y must match.
- Raises:
AssertionError – If x is not strictly smaller than y, elementwise.
ImportError – If
numpyis not importable in the Python environment.
See also
assert_closeSimilar function for inexact equality checks.
numpy.testing.assert_array_lessSimilar function for NumPy arrays.
- Return type: