Skip to content
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions nchs_mortality/delphi_nchs_mortality/archive_diffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
-----------
Expand All @@ -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(
Expand Down
14 changes: 8 additions & 6 deletions nchs_mortality/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down