cmu-delphi / epipredict

Tools for building predictive models in epidemiology.
https://cmu-delphi.github.io/epipredict/
Other
8 stars 9 forks source link

Date processing mismatch #291

Closed dajmcdon closed 6 months ago

dajmcdon commented 8 months ago
  1. The canned forecasters expect forecast_date and target_date to be Date objects.
  2. step_epi_ahead() and step_epi_lag() require lag/ahead to be integers.

This generally works OK unless you're doing annual forecasts (probably also monthly). Then these clash (because of leap years or strange numbers of days).

Suggested fix:

  1. lead / lag processing should handle things like "1 day" or "1 year". They should operate using date arithmetic on the level of the epi_df time_type. So if time type is year, ahead = 1 should automatically convert to "1 year".

This is possibly related to #290 .

Likely requires importing {lubridate} and then downstream licensing issues. See https://github.com/tidyverse/lubridate/issues/968

dajmcdon commented 8 months ago

This is currently blocking #115