super_auto_comb.utils

Functions

parse_input_date(s)

Smart interpretation of input date.

generate_dates(start, stop)

Generate dates from start and stop.

is_summer_time_changing_between(date1, date2[, timezone])

Check for summer time changes by comparing the timezone infos of two dates.

today()

Return today as YYYY-MM-DD

Module Contents

super_auto_comb.utils.parse_input_date(s)

Smart interpretation of input date. Float input > 1 is interpreted as MJD. Float input <= 1 is interpreted as “day ago” (-1 = yesterday, 0 = today, 1 = tomorrow, etc…) Otherwise inputs are parsed as date YYYY-MM-DD.

Parameters:

s (str) – Input.

Returns:

mjd – date as MJD rounded to integer.

Return type:

float

super_auto_comb.utils.generate_dates(start, stop)

Generate dates from start and stop.

Parameters:
  • start (float) – Start date as MJD.

  • stop (float) – Stop date as MJD.

Return type:

list of Datetime

super_auto_comb.utils.is_summer_time_changing_between(date1, date2, timezone='Europe/Rome')

Check for summer time changes by comparing the timezone infos of two dates.

Parameters:
  • date1 (datetime) – First datetime.

  • date2 (datetime) – Second datetime.

  • timezone (str) – Timezone name, by default “Europe/Rome”.

Returns:

True if the two dates as different times.

Return type:

bool

super_auto_comb.utils.today()

Return today as YYYY-MM-DD