Skip to content

Commit

Permalink
Encode week as string
Browse files Browse the repository at this point in the history
This makes it easier to weight on week values from a TSV file.
  • Loading branch information
victorlin committed Aug 5, 2024
1 parent 79732b8 commit a20e727
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion augur/dates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

0 comments on commit a20e727

Please sign in to comment.