Skip to content

Commit c1d416a

Browse files
authored
Merge pull request #1290 from cmu-delphi/release/indicators_v0.1.21_utils_v0.1.15
Release covidcast-indicators 0.1.21
2 parents 2f9c20a + 0caab0e commit c1d416a

File tree

8 files changed

+29
-11
lines changed

8 files changed

+29
-11
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.1.20
2+
current_version = 0.1.21
33
commit = True
44
message = chore: bump covidcast-indicators to {new_version}
55
tag = False

_delphi_utils_python/.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.1.14
2+
current_version = 0.1.15
33
commit = True
44
message = chore: bump delphi_utils to {new_version}
55
tag = False

_delphi_utils_python/delphi_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
from .signal import add_prefix
1515
from .nancodes import Nans
1616

17-
__version__ = "0.1.14"
17+
__version__ = "0.1.15"

_delphi_utils_python/delphi_utils/runner.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any, Callable, Dict, Optional
55
from .archive import ArchiveDiffer, archiver_from_params
66
from .logger import get_structured_logger
7-
from .utils import read_params
7+
from .utils import read_params, transfer_files
88
from .validator.validate import Validator
99
from .validator.run import validator_from_params
1010

@@ -44,8 +44,11 @@ def run_indicator_pipeline(indicator_fn: Callable[[Params], None],
4444
validation_report.log(get_structured_logger(
4545
name = indicator_fn.__module__,
4646
filename=params["common"].get("log_filename", None)))
47-
if archiver and (not validator or validation_report.success()):
48-
archiver.run()
47+
if (not validator or validation_report.success()):
48+
if archiver:
49+
archiver.run()
50+
if "delivery" in params:
51+
transfer_files()
4952

5053

5154
if __name__ == "__main__":

_delphi_utils_python/delphi_utils/utils.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Read parameter files containing configuration information."""
22
# -*- coding: utf-8 -*-
33
from json import load,dump
4-
from os.path import exists
5-
from shutil import copyfile
4+
from shutil import copyfile, move
5+
import os
66
import sys
77

88
def read_params():
@@ -11,7 +11,7 @@ def read_params():
1111
If the file does not exist, it copies the file 'params.json.template' to
1212
'params.json' and then reads the file.
1313
"""
14-
if not exists("params.json"):
14+
if not os.path.exists("params.json"):
1515
copyfile("params.json.template", "params.json")
1616

1717
with open("params.json", "r") as json_file:
@@ -87,3 +87,12 @@ def params_run():
8787
with open("params.json", "w") as f:
8888
dump(params, f, sort_keys=True, indent=2)
8989
print(f"Updated {n} items")
90+
91+
def transfer_files():
92+
"""Transfer files to prepare for acquisition."""
93+
params = read_params()
94+
export_dir = params["common"].get("export_dir", None)
95+
delivery_dir = params["delivery"].get("delivery_dir", None)
96+
files_to_export = os.listdir(export_dir)
97+
for file_name in files_to_export:
98+
move(os.path.join(export_dir, file_name), delivery_dir)

_delphi_utils_python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
setup(
2727
name="delphi_utils",
28-
version="0.1.14",
28+
version="0.1.15",
2929
description="Shared Utility Functions for Indicators",
3030
long_description=long_description,
3131
long_description_content_type="text/markdown",

ansible/templates/google_symptoms-params-prod.json.j2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"common": {
3-
"export_dir": "/common/covidcast/receiving/google-symptoms",
3+
"export_dir": "./receiving",
44
"log_filename": "/var/log/indicators/google_symptoms.log"
55
},
66
"indicator": {
@@ -41,6 +41,9 @@
4141
"sum_anosmia_ageusia_smoothed_search",
4242
"anosmia_smoothed_search"
4343
]
44+
},
45+
"delivery": {
46+
"delivery_dir": "/common/covidcast/receiving/google-symptoms"
4447
}
4548
}
4649
}

google_symptoms/params.json.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"sum_anosmia_ageusia_smoothed_search",
3232
"anosmia_smoothed_search"
3333
]
34+
},
35+
"delivery": {
36+
"delivery_dir": "./receiving"
3437
}
3538
}
3639
}

0 commit comments

Comments
 (0)