def repertoire_distance(direction, r1, r2):
    """Compute the distance between two repertoires for the given direction.

    Args:
        direction (Direction): |CAUSE| or |EFFECT|.
        r1 (np.ndarray): The first repertoire.
        r2 (np.ndarray): The second repertoire.

    Returns:
        float: The distance between ``d1`` and ``d2``, rounded to |PRECISION|.
    """
    if config.MEASURE == 'EMD':
        dist = directional_emd(direction, r1, r2)
    else:
        dist = measures[config.MEASURE](r1, r2)

    return round(dist, config.PRECISION)
Compute the distance between two repertoires for the given direction.

    Args:
        direction (Direction): |CAUSE| or |EFFECT|.
        r1 (np.ndarray): The first repertoire.
        r2 (np.ndarray): The second repertoire.

    Returns:
        float: The distance between ``d1`` and ``d2``, rounded to |PRECISION|.