vocalpy.validators.validators.have_same_dtype

vocalpy.validators.validators.have_same_dtype#

vocalpy.validators.validators.have_same_dtype(arr1: ndarray[Any, dtype[_ScalarType_co]], arr2: ndarray[Any, dtype[_ScalarType_co]], name1: str | None = None, name2: str | None = None) bool[source]#

Validates that two arrays, arr1 and arr2, have the same dtype.

Parameters:
arr1numpy.ndarray

First array to be validated.

arr2numpy.ndarray

Second array to be validated.

name1str, optional

Name of first array in calling function. Used in any error message if both name1 and name2 are supplied.

name2str, optional

Name of second array in calling function. Used in any error message if both name1 and name2 are supplied.

Returns:
have_same_dtypebool

True if arr1 and arr2 have the same dtype.