meridian.data.time_coordinates.normalize_date_interval

Normalizes representations of a date interval into a tuple of dates.

A date interval here is a tuple of [start_date, end_date) where:

  • start_date is inclusive and end_date is exclusive.
  • Both are polymorphic, taking the form of either:
    • datetime.datetime (only the date component will be used)
    • datetime.date (the normalized form)
    • np.datetime64 (only the date component will be used)
    • str (will be parsed as "YYYY-mm-dd" or else throws)

In all instances, the given date interval will be normalized as a tuple of datetime.dates.

date_interval a polymorphic date interval to normalize.

A tuple of dates representing a [start_date, end_date) date interval.