diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 28df68b2a..4c236bd11 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.3.17 +current_version = 0.3.18 commit = True message = chore: bump covidcast-indicators to {new_version} tag = False diff --git a/nchs_mortality/delphi_nchs_mortality/archive_diffs.py b/nchs_mortality/delphi_nchs_mortality/archive_diffs.py index e8b790cee..d41c99eaa 100644 --- a/nchs_mortality/delphi_nchs_mortality/archive_diffs.py +++ b/nchs_mortality/delphi_nchs_mortality/archive_diffs.py @@ -14,8 +14,8 @@ def arch_diffs(params, daily_arch_diff, logger): We check for updates for NCHS mortality data every weekday as how it is reported by NCHS and stash these daily updates on S3, but not our API. - On a weekly level (on Mondays), we additionally upload the changes to the - data made over the past week (due to backfill) to our API. + On a weekly level (on Mondays and Thursdays), we additionally upload the + changes to the data made over the past week (due to backfill) to our API. Parameters: ----------- @@ -29,10 +29,10 @@ def arch_diffs(params, daily_arch_diff, logger): weekly_export_dir = params["common"]["weekly_export_dir"] daily_export_dir = params["common"]["daily_export_dir"] - # Weekly run of archive utility on Monday + # Weekly run of archive utility on Monday and Thursday # - Does not upload to S3, that is handled by daily run of archive utility # - Exports issues into receiving for the API - if datetime.today().weekday() == 0: + if datetime.today().weekday() == (0 or 3): # Copy todays raw output to receiving for output_file in listdir(daily_export_dir): copy( diff --git a/nchs_mortality/tests/test_run.py b/nchs_mortality/tests/test_run.py index b842bd4c1..d1355afd3 100644 --- a/nchs_mortality/tests/test_run.py +++ b/nchs_mortality/tests/test_run.py @@ -7,12 +7,13 @@ class TestRun: - @pytest.mark.parametrize("date", ["2020-09-14", "2020-09-18"]) + # the 14th was a Monday + @pytest.mark.parametrize("date", ["2020-09-14", "2020-09-17", "2020-09-18"]) def test_output_files_exist(self, run_as_module, date): - is_monday = dt.datetime.strptime(date, "%Y-%m-%d").weekday() == 0 + is_mon_or_thurs = dt.datetime.strptime(date, "%Y-%m-%d").weekday() == (0 or 3) folders = ["daily_cache"] - if is_monday: + if is_mon_or_thurs: folders.append("receiving") for output_folder in folders: @@ -48,12 +49,13 @@ def test_output_files_exist(self, run_as_module, date): + metric + "_" + sensor + ".csv"] assert set(expected_files).issubset(set(csv_files)) - @pytest.mark.parametrize("date", ["2020-09-14", "2020-09-18"]) + # the 14th was a Monday + @pytest.mark.parametrize("date", ["2020-09-14", "2020-09-17", "2020-09-18"]) def test_output_file_format(self, run_as_module, date): - is_monday = dt.datetime.strptime(date, "%Y-%m-%d").weekday() == 0 + is_mon_or_thurs = dt.datetime.strptime(date, "%Y-%m-%d").weekday() == (0 or 3) folders = ["daily_cache"] - if is_monday: + if is_mon_or_thurs: folders.append("receiving") for output_folder in folders: