def csep_close(ra, rb):
    """Return the closest separation vector between each point in one set,
    and every point in a second set.

    Parameters
    ----------
    ra, rb: float array-like, shape (n, d) and (m, d) in d dimensions.
        Two sets of points. `ra` is the set of points from which the closest
        separation vectors to points `rb` are calculated.

    Returns
    -------
    csep_close: float array-like, shape (n, m, d)
        csep[i] is the closest separation vector from point ra[j]
        to any point rb[i].
        Note the un-intuitive vector direction.
    """
    seps = csep(ra, rb)
    seps_sq = np.sum(np.square(seps), axis=-1)

    i_close = np.argmin(seps_sq, axis=-1)

    i_all = list(range(len(seps)))
    sep = seps[i_all, i_close]
    sep_sq = seps_sq[i_all, i_close]
    return sep, sep_sq
Return the closest separation vector between each point in one set,
    and every point in a second set.

    Parameters
    ----------
    ra, rb: float array-like, shape (n, d) and (m, d) in d dimensions.
        Two sets of points. `ra` is the set of points from which the closest
        separation vectors to points `rb` are calculated.

    Returns
    -------
    csep_close: float array-like, shape (n, m, d)
        csep[i] is the closest separation vector from point ra[j]
        to any point rb[i].
        Note the un-intuitive vector direction.