Skip to content

Commit b2e1b0c

Browse files
authored
Merge pull request #1860 from cmu-delphi/release/indicators_v0.3.41_utils_v0.3.16
Release covidcast-indicators 0.3.41
2 parents 9f74a6c + 0437191 commit b2e1b0c

File tree

13 files changed

+27
-14
lines changed

13 files changed

+27
-14
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.40
2+
current_version = 0.3.41
33
commit = True
44
message = chore: bump covidcast-indicators to {new_version}
55
tag = False

changehc/delphi_changehc/run.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ def make_asserts(params):
7878
assert (files["denom"] is None) == (files["flu"] is None), \
7979
"exactly one of denom and flu files are provided"
8080

81+
def process_dates(params, startdate_dt, enddate_dt):
82+
"""Process the start and end dates for indicator."""
83+
enddate = params["indicator"].get("end_date")
84+
if enddate is None:
85+
enddate = str(enddate_dt.date())
86+
startdate = params["indicator"].get("start_date", str(startdate_dt.date()))
87+
if startdate is None:
88+
startdate = str(startdate_dt.date())
89+
return startdate, enddate
90+
8191

8292
def run_module(params: Dict[str, Dict[str, Any]]):
8393
"""
@@ -144,8 +154,8 @@ def run_module(params: Dict[str, Dict[str, Any]]):
144154
enddate_dt = dropdate_dt - timedelta(days=n_waiting_days)
145155
startdate_dt = enddate_dt - timedelta(days=n_backfill_days)
146156
# now allow manual overrides
147-
enddate = enddate = params["indicator"].get("end_date",str(enddate_dt.date()))
148-
startdate = params["indicator"].get("start_date", str(startdate_dt.date()))
157+
158+
startdate, enddate = process_dates(params, startdate_dt, enddate_dt)
149159

150160
logger.info("generating signal and exporting to CSV",
151161
first_sensor_date = startdate,

changehc/delphi_changehc/update_sensor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def geo_reindex(self, data):
160160
thr_col="den",
161161
mega_col=geo,
162162
date_col=Config.DATE_COL)
163+
# this line should be removed once the fix is implemented for megacounties
164+
data_frame = data_frame[~((data_frame['county'].str.len() > 5) | (data_frame['county'].str.contains('_')))]
163165
elif geo == "state":
164166
data_frame = gmpr.replace_geocode(data, "fips", "state_id", new_col="state",
165167
date_col=Config.DATE_COL)
@@ -172,7 +174,8 @@ def geo_reindex(self, data):
172174
multiindex = pd.MultiIndex.from_product((unique_geo_ids, self.fit_dates),
173175
names=[geo, Config.DATE_COL])
174176
assert (len(multiindex) <= (len(gmpr.get_geo_values(gmpr.as_mapper_name(geo))) * len(self.fit_dates))
175-
), "more loc-date pairs than maximum number of geographies x number of dates"
177+
), f"more loc-date pairs than maximum number of geographies x number of dates, length of multiindex is {len(multiindex)}, geo level is {geo}"
178+
176179
# fill dataframe with missing dates using 0
177180
data_frame = data_frame.reindex(multiindex, fill_value=0)
178181
data_frame.fillna(0, inplace=True)

changehc/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

claims_hosp/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

doctor_visits/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

dsew_community_profile/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

google_symptoms/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

hhs_hosp/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

nchs_mortality/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

nowcast/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

quidel_covidtest/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

sir_complainsalot/version.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
current_version = 0.3.40
1+
current_version = 0.3.41

0 commit comments

Comments
 (0)