NumPy based implementation of get_min_distance

def _get_min_distance_numpy(element):
    """
    NumPy based implementation of get_min_distance
    """
    xys = element.array([0, 1])
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore', r'invalid value encountered in')
        xys = xys.astype('float32').view(np.complex64)
        distances = np.abs(xys.T-xys)
        np.fill_diagonal(distances, np.inf)
        distances = distances[distances>0]
        if len(distances):
            return distances.min()
    return 0