def METHOD_NAME(self, x0, x1, metric):
    """
    Compute the distance between points x0 and x1 place on the grid
    using periodic boundary conditions.
    :param ~numpy.ndarray(int) x0: first point in space
    :param ~numpy.ndarray(int) x1: second point in space
    :param ~numpy.ndarray(int) grid: shape of grid
    :param str metric:
        distance metric, i.e. ``euclidian`` or ``manhattan`` or
        ``equidistant``
    :return: the distance
    :rtype: float
    """
    x0 = numpy.asarray(x0)
    x1 = numpy.asarray(x1)
    delta = numpy.abs(x0 - x1)
    if (delta[0] > self.__grid[0] * .5) and self.__grid[0] > 0:
        delta[0] -= self.__grid[0]
    if (delta[1] > self.__grid[1] * .5) and self.__grid[1] > 0:
        delta[1] -= self.__grid[1]
    if metric == 'manhattan':
        return numpy.abs(delta).sum(axis=-1)
    elif metric == 'equidistant':
        p = 4
        exponents = numpy.power(delta, [p] * delta.size)
        return numpy.floor(numpy.power(exponents.sum(axis=-1), [1. / p]))
    return numpy.sqrt((delta ** 2).sum(axis=-1))