def generate_key(trip):
    """Generate a unique key from the given trip

    The 'trip_id' is only unique with in it's scheduled day.  Thus, we
    need to use both trip_id and the start_date to get a globally
    unique ID from a train run.

    Parameters
    ----------
    trip : TripDescriptor

    Returns
    -------
    key : tuple

    """
    return (trip.start_date, trip.trip_id)