Skip to content

Commit 4cdaa83

Browse files
authored
Merge pull request #886 from benjaminysmith/sircal
Fix bug in sircal where a single day of data will fail when checking gaps
2 parents 6ac2f30 + 96217fc commit 4cdaa83

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sir_complainsalot/delphi_sir_complainsalot/check_source.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ def check_source(data_source, meta, params, grace, logger):
119119

120120
gap_days = [(day - prev_day).days
121121
for day, prev_day in zip(unique_dates[1:], unique_dates[:-1])]
122+
123+
# If we only have a single day of data available then gap days will be
124+
# empty.
125+
if not gap_days:
126+
logger.info(
127+
"Not enough data to calculate gap days.",
128+
data_source=data_source,
129+
signal=row["signal"],
130+
geo_type=row["geo_type"])
131+
continue
132+
122133
gap = max(gap_days) - 1
123134
logger.info("Detecting days with data present",
124135
data_source = data_source,

0 commit comments

Comments
 (0)