You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is used by augur filter when called with --group-by week
Also note there is some date parsing that currently lives outside of augur.dates:
augur filter when called with --group-by <year|month|week> parses dates in the form of <year>-<month>-<day>, <year>-<month>, or <year> (src)
Potential solutions
Merge numeric_date() and get_numerical_date_from_value() since these are serving similar purposes.
Leave is_date_ambiguous() as-is since it serves its purpose and is not duplicated. No point in trying to use numeric_date() internally since ambiguous dates must be in ISO format.
Leave get_iso_year_week() as-is since it serves its purpose and is not duplicated. No point in trying to use numeric_date() internally since this is only used by augur filter --group-by which requires ISO format.
For augur filter --group-by <year|month|week>, first run the date string through numeric_date() then convert to ISO date which can be split into year/month/date parts. If the conversion is not possible (i.e. negative date), just drop the sequence.
Context
Date parsing across Augur has come about in the form of convergent evolution, with separate functions trying to do roughly the same thing. A summary:
numeric_date()
--min-date/--max-date
options toaugur filter
andaugur frequencies
(vianumeric_date_type()
)get_numerical_date_from_value()
date
column inaugur filter
,augur frequencies
,augur refine
(viaget_numerical_dates()
)date
column inaugur parse
is_date_ambiguous()
augur filter --exclude-ambiguous-dates-by
<year>-<month>-<day>
,<year>-<month>
, or<year>
datesget_iso_year_week()
augur filter
when called with--group-by week
Also note there is some date parsing that currently lives outside of
augur.dates
:augur filter
when called with--group-by <year|month|week>
parses dates in the form of<year>-<month>-<day>
,<year>-<month>
, or<year>
(src)Potential solutions
numeric_date()
andget_numerical_date_from_value()
since these are serving similar purposes.is_date_ambiguous()
as-is since it serves its purpose and is not duplicated. No point in trying to usenumeric_date()
internally since ambiguous dates must be in ISO format.get_iso_year_week()
as-is since it serves its purpose and is not duplicated. No point in trying to usenumeric_date()
internally since this is only used byaugur filter --group-by
which requires ISO format.augur filter --group-by <year|month|week>
, first run the date string throughnumeric_date()
then convert to ISO date which can be split into year/month/date parts. If the conversion is not possible (i.e. negative date), just drop the sequence.Progress
utils
todates
#923parse.fix_dates()
frequency_estimators.py
: incorporatefloat_to_datestring()
,timestamp_to_float()
Issues that should be fixed as a result of this work
--max-date
with year only is not inclusive #893The text was updated successfully, but these errors were encountered: