def array_identical(u, v):
    """
    compares whether all elements are equal between two numpy arrays.
    """
    if u.shape != v.shape:
        return False
    for a, b in zip(u.flat, v.flat):
        if a != b:
            return False
    return True