def cluster_profile_query(city):
    """SQL query to get cluster descriptions as 24-houred timeseries within `city`

    Parameters
    ----------
    city : str
        City of interest, either ̀bordeaux` or `lyon`

    Returns
    -------
    str
        SQL query that gives the timeseries cluster profile in `city`

    """
    if city not in ('bordeaux', 'lyon'):
        raise ValueError("City '{}' not supported.".format(city))
    return ("WITH ranked_centroids AS ("
            "SELECT *, rank() OVER (ORDER BY stop DESC) AS rank "
            "FROM {schema}.{centroid}) "
            "SELECT cluster_id, "
            "h00, h01, h02, h03, h04, h05, h06, h07, h08, h09, h10, h11, "
            "h12, h13, h14, h15, h16, h17, h18, h19, h20, h21, h22, h23, "
            "start, stop "
            "FROM ranked_centroids "
            "WHERE rank=1"
            ";").format(schema=city,
                        centroid='centroid')