Skip to content

Commit 49c6c29

Browse files
authored
Merge branch 'main' into krivard/refactor-archiver-tests
2 parents 067deff + 59481e3 commit 49c6c29

File tree

19 files changed

+381
-77
lines changed

19 files changed

+381
-77
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.3.2
2+
current_version = 0.3.6
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.3.1
2+
current_version = 0.3.2
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
@@ -15,4 +15,4 @@
1515
from .nancodes import Nans
1616
from .weekday import Weekday
1717

18-
__version__ = "0.3.1"
18+
__version__ = "0.3.2"

_delphi_utils_python/setup.py

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

2727
setup(
2828
name="delphi_utils",
29-
version="0.3.1",
29+
version="0.3.2",
3030
description="Shared Utility Functions for Indicators",
3131
long_description=long_description,
3232
long_description_content_type="text/markdown",

_delphi_utils_python/tests/test_archive.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,13 @@ def test_diff_and_filter_exports(self, tmp_path):
290290
"aws_secret_access_key": "FAKE_TEST_SECRET_ACCESS_KEY",
291291
}
292292

293-
@pytest.fixture(scope="function")
294-
def s3_client():
295-
with mock_s3():
296-
yield Session(**AWS_CREDENTIALS).client("s3")
297-
298-
299293
class TestS3ArchiveDiffer(ArchiveDifferTestlike):
300294
bucket_name = "test-bucket"
301295
indicator_prefix = "test"
302296

303297
@mock_s3
304-
def test_update_cache(self, tmp_path, s3_client):
298+
def test_update_cache(self, tmp_path):
299+
s3_client = Session(**AWS_CREDENTIALS).client("s3")
305300
cache_dir, export_dir = self.set_up(tmp_path)
306301

307302
csv1 = CSVS["mod_2_del_3_add_4"].before
@@ -336,7 +331,8 @@ def test_update_cache(self, tmp_path, s3_client):
336331
assert set(listdir(cache_dir)) == {"csv1.csv", "csv2.csv"}
337332

338333
@mock_s3
339-
def test_archive_exports(self, tmp_path, s3_client):
334+
def test_archive_exports(self, tmp_path):
335+
s3_client = Session(**AWS_CREDENTIALS).client("s3")
340336
cache_dir, export_dir = self.set_up(tmp_path)
341337

342338
csv1 = CSVS["mod_2_del_3_add_4"].before
@@ -364,7 +360,8 @@ def test_archive_exports(self, tmp_path, s3_client):
364360
assert_frame_equal(pd.read_csv(body, dtype=CSV_DTYPES), csv1)
365361

366362
@mock_s3
367-
def test_run(self, tmp_path, s3_client):
363+
def test_run(self, tmp_path):
364+
s3_client = Session(**AWS_CREDENTIALS).client("s3")
368365
cache_dir, export_dir = self.set_up(tmp_path)
369366

370367
s3_client.create_bucket(Bucket=self.bucket_name)

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
"indicator": {
77
"input_cache": "./input_cache",
88
"reports": "new",
9-
"export_signals": ["confirmed covid-19 admissions"]
9+
"export_signals": [
10+
"confirmed covid-19 admissions",
11+
"doses administered",
12+
"booster doses administered",
13+
"fully vaccinated",
14+
"booster dose since"
15+
]
1016
},
1117
"validation": {
1218
"common": {
@@ -28,7 +34,9 @@
2834
"naats_total_7dav",
2935
"naats_positivity_7dav",
3036
"confirmed_admissions_covid_1d_prop_7dav",
31-
"confirmed_admissions_covid_1d_7dav"
37+
"confirmed_admissions_covid_1d_7dav",
38+
"doses_admin_7dav",
39+
"booster_doses_admin_7dav"
3240
]
3341
}
3442
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
["smoothed_vaccine_barrier_travel_tried", "msa"], ["smoothed_wvaccine_barrier_travel_tried", "msa"],
9393
["smoothed_vaccine_barrier_type_tried", "msa"], ["smoothed_wvaccine_barrier_type_tried", "msa"],
9494
["smoothed_try_vaccinate_1m", "hrr"], ["smoothed_wtry_vaccinate_1m", "hrr"],
95+
["smoothed_try_vaccinate_1m", "msa"], ["smoothed_wtry_vaccinate_1m", "msa"],
9596
["smoothed_dontneed_reason_dont_spend_time", "hrr"], ["smoothed_wdontneed_reason_dont_spend_time", "hrr"],
9697
["smoothed_dontneed_reason_had_covid", "hrr"], ["smoothed_wdontneed_reason_had_covid", "hrr"],
9798
["smoothed_dontneed_reason_not_beneficial", "hrr"], ["smoothed_wdontneed_reason_not_beneficial", "hrr"],
@@ -137,7 +138,13 @@
137138
"quidel": {
138139
"max_age":6,
139140
"maintainers": ["U01AP8GSWG3","U01069KCRS7"],
140-
"retired-signals": ["raw_pct_negative","smoothed_pct_negative","raw_tests_per_device","smoothed_tests_per_device"]
141+
"retired-signals": [
142+
"raw_pct_negative","smoothed_pct_negative","raw_tests_per_device","smoothed_tests_per_device",
143+
["covid_ag_raw_pct_positive_age_0_4", "hrr"], ["covid_ag_raw_pct_positive_age_0_4", "msa"],
144+
["covid_ag_raw_pct_positive_age_5_17", "hrr"], ["covid_ag_raw_pct_positive_age_5_17", "msa"],
145+
["covid_ag_raw_pct_positive_age_50_64", "hrr"], ["covid_ag_raw_pct_positive_age_50_64", "msa"],
146+
["covid_ag_raw_pct_positive_age_65plus", "hrr"], ["covid_ag_raw_pct_positive_age_65plus", "msa"]
147+
]
141148
},
142149
"nchs-mortality": {
143150
"max_age":16,

dsew_community_profile/delphi_dsew_community_profile/constants.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,50 @@ class Transform:
5151
"total": {
5252
"is_rate" : False,
5353
"api_name": "naats_total_7dav",
54-
"make_prop": False
54+
"make_prop": False,
55+
"cumulative" : False
5556
},
5657
"positivity": {
5758
"is_rate" : True,
5859
"api_name": "naats_positivity_7dav",
59-
"make_prop": False
60+
"make_prop": False,
61+
"cumulative" : False
6062
},
6163
"confirmed covid-19 admissions": {
6264
"is_rate" : False,
6365
"api_name": "confirmed_admissions_covid_1d_7dav",
6466
"make_prop": True,
65-
"api_prop_name": "confirmed_admissions_covid_1d_prop_7dav"
67+
"api_prop_name": "confirmed_admissions_covid_1d_prop_7dav",
68+
"cumulative" : False
69+
},
70+
"fully vaccinated": {
71+
"is_rate" : False,
72+
"api_name": "people_full_vaccinated",
73+
"make_prop": False,
74+
"cumulative" : True
75+
},
76+
"booster dose since": {
77+
"is_rate" : False,
78+
"api_name": "people_booster_doses",
79+
"make_prop": False,
80+
"cumulative" : True
81+
},
82+
"booster doses administered": {
83+
"is_rate" : False,
84+
"api_name": "booster_doses_admin_7dav",
85+
"make_prop": False,
86+
"cumulative" : False
87+
},
88+
"doses administered": {
89+
"is_rate" : False,
90+
"api_name": "doses_admin_7dav",
91+
"make_prop": False,
92+
"cumulative" : False
6693
}
6794
}
6895

69-
COUNTS_7D_SIGNALS = {key for key, value in SIGNALS.items() if not value["is_rate"]}
96+
COUNTS_7D_SIGNALS = {key for key, value in SIGNALS.items() \
97+
if not((value["is_rate"]) or (value["cumulative"]))}
7098

7199
def make_signal_name(key, is_prop=False):
72100
"""Convert a signal key to the corresponding signal name for the API.

0 commit comments

Comments
 (0)