vocalpy.validators.validators.have_same_dtype#
- vocalpy.validators.validators.have_same_dtype(arr1: ndarray[tuple[Any, ...], dtype[_ScalarT]], arr2: ndarray[tuple[Any, ...], dtype[_ScalarT]], name1: str | None = None, name2: str | None = None) bool[source]#
Validates that two arrays,
arr1andarr2, have the samedtype.- 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
name1andname2are supplied.- name2str, optional
Name of second array in calling function. Used in any error message if both
name1andname2are supplied.
- Returns:
- have_same_dtypebool
True if
arr1andarr2have the samedtype.