meridian.data.time_coordinates.normalize_date_interval

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

A date interval here is a (start_date, end_date) tuple. Both dates 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 (start_date, end_date) tuple of dates.