Skip to content

Release covidcast-indicators 0.3.29 #1770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c2e8190
add code for backfill
Aug 4, 2022
d74b187
add issue_date and lag to backfill file
Aug 12, 2022
64bc15e
Update ansible file for claims_hosp
jingjtang Aug 20, 2022
de888aa
Fix the name of backfill path
jingjtang Aug 20, 2022
983fde8
Use get_date() for issue date
jingjtang Aug 20, 2022
a8dc212
Finish the comment for merging
jingjtang Aug 20, 2022
c2395b7
remove index arg when saving parquet files; add state_id for backfill
Sep 1, 2022
9308071
fix the bug
Sep 1, 2022
abc20b2
use smaller test files
Sep 2, 2022
90fed9f
add the correct test file
Sep 2, 2022
c84ea3f
delete backfill test files
Sep 6, 2022
3d02733
add the case when there is no daily file stored
Sep 6, 2022
2f48fed
fix the test error
Sep 6, 2022
7d26143
Merge pull request #1745 from cmu-delphi/bot/sync-prod-main
krivard Dec 14, 2022
43885e2
Fix validation steps for no-output case
M5Skid Dec 16, 2022
1b9b95f
Empty dir check made into a warning in validation
M5Skid Dec 20, 2022
a1f597b
Add better notes and tweak files check
M5Skid Dec 20, 2022
bfb0215
Empty filelist check now an error, suppress-able
M5Skid Dec 20, 2022
6bd1666
Static test returned to original form
M5Skid Dec 20, 2022
793ea14
fixed indents in static.py
M5Skid Jan 4, 2023
04611aa
fetch user-provided paths once only
nmdefries Jan 10, 2023
6e7df34
increase install timeout for delphi_utils
nmdefries Jan 10, 2023
66fb6ea
Add new/modify (build + package) + deploy stage to accommodate the ne…
minhkhul Jan 10, 2023
3d2581f
Merge pull request #1754 from cmu-delphi/ndefries/backcorr-eval-vars-…
krivard Jan 11, 2023
18fbc56
Merge pull request #1755 from cmu-delphi/1747-add-newmodify-build-+-p…
korlaxxalrok Jan 12, 2023
ff9d515
move lag and issue_date setting to daily files in change
nmdefries Jan 12, 2023
f3a2e33
move lag and issue_date setting to daily files in quidel_covidtest
nmdefries Jan 12, 2023
530b687
move lag and issue_date setting to daily files
nmdefries Jan 12, 2023
04b6fec
rename fips to geo_value as needed
nmdefries Jan 12, 2023
75ca624
check date, lag fields present and not NA
nmdefries Jan 13, 2023
34a695a
Deactivate USAFacts
minhkhul Jan 13, 2023
5013647
Merge branch 'main' into deactivate-usafacts
minhkhul Jan 13, 2023
3704566
Merge pull request #1762 from cmu-delphi/deactivate-usafacts
krivard Jan 13, 2023
6dcafa9
Merge branch 'main' into backfill/claims_hosp
nmdefries Jan 13, 2023
6344fb2
cp params inside of container so changes aren't propagated
nmdefries Jan 13, 2023
a0c9e3d
Merge pull request #1675 from cmu-delphi/backfill/claims_hosp
krivard Jan 17, 2023
345b424
Merge pull request #1761 from cmu-delphi/ndefries/backfill/rename-fips
krivard Jan 17, 2023
31b8a85
run only if params copy succeeded
nmdefries Jan 18, 2023
4641604
Merge pull request #1763 from cmu-delphi/ndefries/backfill/restore-pa…
krivard Jan 18, 2023
4d8f708
convert date fields from str to date; set default field names in main
nmdefries Jan 20, 2023
a10aa13
check date fields; pass default col names to checks fn
nmdefries Jan 20, 2023
4b2e7c5
Merge pull request #1760 from cmu-delphi/ndefries/backcorr-input-format
krivard Jan 23, 2023
38adec3
Merge pull request #1764 from cmu-delphi/ndefries/backfill/date-as-str
krivard Jan 23, 2023
5299d83
delete combo_cases_and_deaths
minhkhul Jan 24, 2023
13e229d
add back in missing file check
M5Skid Jan 24, 2023
59c3d4c
Merge pull request #1 from cmu-delphi/main
M5Skid Jan 24, 2023
8d5fc6b
Update test_static.py
M5Skid Jan 24, 2023
a3b3b7d
Merge pull request #1766 from cmu-delphi/deactivate-combo
krivard Jan 25, 2023
3cf7107
deactivate covid_act_now
minhkhul Jan 26, 2023
651c048
Merge pull request #1749 from M5Skid/issue1746_validator-no-output
krivard Jan 27, 2023
13d1729
Merge pull request #1769 from cmu-delphi/deactivate-covid-act-now
krivard Jan 27, 2023
c796b48
chore: bump delphi_utils to 0.3.8
Jan 30, 2023
73d9717
chore: bump covidcast-indicators to 0.3.29
Jan 30, 2023
99c7459
[create-pull-request] automated change
krivard Jan 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.28
current_version = 0.3.29
commit = True
message = chore: bump covidcast-indicators to {new_version}
tag = False
2 changes: 1 addition & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event.pull_request.draft == false
strategy:
matrix:
packages: [_delphi_utils_python, changehc, claims_hosp, combo_cases_and_deaths, doctor_visits, dsew_community_profile, google_symptoms, hhs_hosp, hhs_facilities, jhu, nchs_mortality, nowcast, quidel, quidel_covidtest, safegraph_patterns, sir_complainsalot, usafacts]
packages: [_delphi_utils_python, changehc, claims_hosp, doctor_visits, dsew_community_profile, google_symptoms, hhs_hosp, hhs_facilities, jhu, nchs_mortality, nowcast, quidel, quidel_covidtest, safegraph_patterns, sir_complainsalot]
defaults:
run:
working-directory: ${{ matrix.packages }}
Expand Down
29 changes: 23 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,43 @@
- Keep in sync with '.github/workflows/python-ci.yml'.
- TODO: #527 Get this list automatically from python-ci.yml at runtime.
*/
def indicator_list = ["backfill_corrections", "changehc", "claims_hosp", "google_symptoms", "hhs_hosp", "jhu", "nchs_mortality", "quidel", "quidel_covidtest", "safegraph_patterns", "sir_complainsalot", "usafacts", "dsew_community_profile", "doctor_visits"]
def build_package = [:]

def indicator_list = ["backfill_corrections", "changehc", "claims_hosp", "google_symptoms", "hhs_hosp", "jhu", "nchs_mortality", "quidel", "quidel_covidtest", "safegraph_patterns", "sir_complainsalot", "dsew_community_profile", "doctor_visits"]
def build_package_main = [:]
def build_package_prod = [:]
def deploy_staging = [:]
def deploy_production = [:]

pipeline {
agent any
stages {
stage('Build and Package') {
stage('Build and Package main') {
when {
branch "main";
}
steps {
script {
indicator_list.each { indicator ->
build_package[indicator] = {
sh "jenkins/build-and-package.sh ${indicator}"
build_package_main[indicator] = {
sh "jenkins/build-and-package.sh ${indicator} main"
}
}
parallel build_package_main
}
}
}
stage('Build and Package prod') {
when {
branch "prod";
}
steps {
script {
indicator_list.each { indicator ->
build_package_prod[indicator] = {
sh "jenkins/build-and-package.sh ${indicator} prod"
}
}
parallel build_package
parallel build_package_prod
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.7
current_version = 0.3.8
commit = True
message = chore: bump delphi_utils to {new_version}
tag = False
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/delphi_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
from .nancodes import Nans
from .weekday import Weekday

__version__ = "0.3.7"
__version__ = "0.3.8"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"validation": {
"global": {
"data_source": "usa-facts",
"data_source": "jhu-csse",
"end_date": "2020-09-08",
"span_length": 3,
"suppressed_errors": [
Expand Down
48 changes: 27 additions & 21 deletions _delphi_utils_python/delphi_utils/validator/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,34 @@ def check_missing_date_files(self, daily_filenames, report):
Returns:
- None
"""
# Create set of all dates seen in CSV names.
unique_dates = {datetime.strptime(
daily_filename[0][0:8], '%Y%m%d').date() for daily_filename in daily_filenames}

# Diff expected and observed dates.
expected_dates = self.params.time_window.date_seq

if len(self.params.max_expected_lag) == 0:
max_expected_lag_overall = 10
else:
max_expected_lag_overall = max(self.params.max_expected_lag.values())

# Only check for date if it should definitely be present,
# i.e if it is more than max_expected_lag since the checking date
expected_dates = [date for date in expected_dates if
((datetime.today().date() - date).days) > max_expected_lag_overall]
check_dateholes = list(set(expected_dates).difference(unique_dates))
check_dateholes.sort()

if check_dateholes:
# Check to see if there are any files in the export directory
# Validator will throw an error if the directory is empty, which can be suppressed
if len(daily_filenames) == 0:
report.add_raised_error(
ValidationFailure("check_missing_date_files",
ValidationFailure("check_empty_filelist",
message="No files found in export directory"))
# Check for missing date only happens when files are found
else:
# Create set of all dates seen in CSV names.
unique_dates = {datetime.strptime(
daily_filename[0][0:8], '%Y%m%d').date() for daily_filename in daily_filenames}
# Diff expected and observed dates.
expected_dates = self.params.time_window.date_seq
if len(self.params.max_expected_lag) == 0:
max_expected_lag_overall = 10
else:
max_expected_lag_overall = max(self.params.max_expected_lag.values())

# Only check for date if it should definitely be present,
# i.e if it is more than max_expected_lag since the checking date
expected_dates = [date for date in expected_dates if
((datetime.today().date() - date).days) > max_expected_lag_overall]
check_dateholes = list(set(expected_dates).difference(unique_dates))
check_dateholes.sort()

if check_dateholes:
report.add_raised_error(
ValidationFailure("check_missing_date_files",
message="Missing dates are observed; if these dates are already "
"in the API they would not be updated"))

Expand Down
6 changes: 5 additions & 1 deletion _delphi_utils_python/delphi_utils/validator/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def validate(self):
frames_list = load_all_files(self.export_dir, self.time_window.start_date,
self.time_window.end_date)
self.static_validation.validate(frames_list, report)
all_frames = aggregate_frames(frames_list)
# Check if frames_list is empty before calling aggregate_frames
if len(frames_list) == 0:
all_frames = []
else:
all_frames = aggregate_frames(frames_list)
self.dynamic_validation.validate(all_frames, report)
return report
2 changes: 1 addition & 1 deletion _delphi_utils_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

setup(
name="delphi_utils",
version="0.3.7",
version="0.3.8",
description="Shared Utility Functions for Indicators",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
20 changes: 20 additions & 0 deletions _delphi_utils_python/tests/validator/test_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,29 @@ def test_empty_filelist(self):
filenames = list()
validator.check_missing_date_files(filenames, report)

assert len(report.raised_errors) == 1
assert report.raised_errors[0].check_name == "check_empty_filelist"

def test_missing_date_files(self):
params = {
"common": {
"data_source": "",
"span_length": 5,
"end_date": "2020-09-05",
"max_expected_lag": {"all": "1"}
}
}
validator = StaticValidator(params)
report = ValidationReport([])
filenames = [("20200901_county_signal_signal.csv", "match_obj"),
("20200903_county_signal_signal.csv", "match_obj"),
("20200904_county_signal_signal.csv", "match_obj"),
("20200905_county_signal_signal.csv", "match_obj")]
validator.check_missing_date_files(filenames, report)
assert len(report.raised_errors) == 1
assert report.raised_errors[0].check_name == "check_missing_date_files"


def test_same_day(self):
params = {
"common": {
Expand Down
2 changes: 1 addition & 1 deletion ansible/ansible-deploy-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
tasks:
- name: Copy and unarchive the package into the indicators runtime host directory.
unarchive:
src: "{{ jenkins_artifact_dir }}/{{ package }}"
src: "{{ jenkins_artifact_dir }}/{{ package_staging }}"
dest: "{{ indicators_runtime_dir }}"
owner: "{{ runtime_user }}"
group: "{{ runtime_user }}"
Expand Down
2 changes: 1 addition & 1 deletion ansible/ansible-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
tasks:
- name: Copy and unarchive the package into the indicators runtime host directory.
unarchive:
src: "{{ jenkins_artifact_dir }}/{{ package }}"
src: "{{ jenkins_artifact_dir }}/{{ package_production }}"
dest: "{{ indicators_runtime_dir }}"
owner: "{{ runtime_user }}"
group: "{{ runtime_user }}"
Expand Down
2 changes: 2 additions & 0 deletions ansible/templates/claims_hosp-params-prod.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"start_date": "2020-02-01",
"end_date": null,
"drop_date": null,
"backfill_dir": "/common/backfill/claims_hosp",
"backfill_merge_day": 0,
"n_backfill_days": 70,
"n_waiting_days": 3,
"write_se": false,
Expand Down
51 changes: 0 additions & 51 deletions ansible/templates/covid_act_now-params-prod.json.j2

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/templates/sir_complainsalot-params-prod.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
"sum_anosmia_ageusia_smoothed_search"
]
},
"usa-facts": {
"max_age": 5,
"maintainers": ["U01AP8GSWG3","U01069KCRS7"],
"retired-signals": ["confirmed_7dav_cumulative_num", "confirmed_7dav_cumulative_prop", "deaths_7dav_cumulative_num", "deaths_7dav_cumulative_prop"]
},
"jhu-csse": {
"max_age": 2,
"maintainers": ["U01AP8GSWG3","U01069KCRS7"],
Expand Down
55 changes: 0 additions & 55 deletions ansible/templates/usafacts-params-prod.json.j2

This file was deleted.

3 changes: 2 additions & 1 deletion ansible/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ runtime_user: "indicators"
jenkins_user: "jenkins"
jenkins_artifact_dir: "/var/lib/jenkins/artifacts"
indicators_runtime_dir: "/home/{{ runtime_user }}/runtime"
package: "{{ indicator }}.tar.gz" # {{ indicator }} is passed in from the Jenkins shell script wrapper.
package_staging: "main_{{ indicator }}.tar.gz" # {{ indicator }} is passed in from the Jenkins shell script wrapper.
package_production: "prod_{{ indicator }}.tar.gz" # {{ indicator }} is passed in from the Jenkins shell script wrapper.
python_version: "3.8.2"
pyenv_python_path: "/home/{{ runtime_user }}/.pyenv/versions/{{ python_version }}/bin/python"

Expand Down
Loading