def smooth_neighbours(smooth_factor, depth1, depth2):
    """Adjust a pair of depths by smooth_factor times their average.

    :arg smooth_factor: Fraction of the average depth to change
                        the depths by
    :type smooth_factor: float

    :arg depth1: First depth to adjust
    :type depth1: float

    :arg depth2: Second depth to adjust
    :type depth2: float

    :returns: Adjusted depths
    :rtype: 2-tuple
    """
    avg = (depth1 + depth2) / 2
    change = smooth_factor if depth1 < depth2 else -smooth_factor
    depth1 += change * avg
    depth2 -= change * avg
    return depth1, depth2