From a20e7279f91792438f07699b42826e6037e582ca Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Thu, 9 May 2024 10:34:13 -0700 Subject: [PATCH] Encode week as string This makes it easier to weight on week values from a TSV file. --- augur/dates/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/augur/dates/__init__.py b/augur/dates/__init__.py index 046638826..57b820a5e 100644 --- a/augur/dates/__init__.py +++ b/augur/dates/__init__.py @@ -144,4 +144,5 @@ def get_numerical_dates(metadata:pd.DataFrame, name_col = None, date_col='date', return dict(zip(strains, dates)) def get_iso_year_week(year, month, day): - return datetime.date(year, month, day).isocalendar()[:2] + year, week = datetime.date(year, month, day).isocalendar()[:2] + return f"{year}-{week}"