reichlab / forecast-repository

Codebase for Zoltar forecast repository
https://zoltardata.com/
GNU General Public License v3.0
6 stars 3 forks source link

Add Target.MMWR_WEEK_LAST_TIMEZERO_SATURDAY reference date type #370

Closed matthewcornell closed 1 year ago

matthewcornell commented 1 year ago

@nickreich's code from meeting:

if timezero.timezero_date.weekday() == 5:  # Sat
    reference_date = timezero.timezero_date
else:  # Sun, Mon, Tue, Wed, Thu, or Fri
    next_sat = relativedelta.relativedelta(weekday=relativedelta.SA(1))
    reference_date = timezero.timezero_date + next_sat