Skip to content

Commit c6c7314

Browse files
authored
Merge pull request #677 from cmu-delphi/release/delphi-epidata-0.2.7
Release Delphi Epidata 0.2.7
2 parents 81f24a9 + a011f12 commit c6c7314

File tree

19 files changed

+360
-326
lines changed

19 files changed

+360
-326
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.2.6
2+
current_version = 0.2.7
33
commit = False
44
tag = False
55

docs/symptom-survey/problems.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,50 @@ interpretation of results. All problems will be logged here.
1717
1. TOC
1818
{:toc}
1919

20+
## Incorrect Wave Sampling (June-August, 2021)
21+
22+
A sampling error caused a portion of our respondents to be accidentally sent the
23+
Wave 10 survey instrument instead of the newer Wave 11 survey instrument. The
24+
error was fixed on August 2, 2021, but as a result of this error:
25+
26+
* A random 1% of the sample was accidentally sent the W10 instrument between
27+
June 15 and July 4, 2021.
28+
* A random 3% of the sample was accidentally sent the W10 instrument between
29+
July 5 and July 11, 2021.
30+
* A random 10% of the sample was accidentally sent the W10 instrument between
31+
July 12 and July 21, 2021.
32+
* A random 50% of the sample was accidentally sent the W10 instrument between
33+
July 22 and July 30, 2021.
34+
* A random 91-98% of the sample was accidentally sent the W10 instrument between
35+
July 31 and August 1, 2021.
36+
37+
Despite differences between the two instruments, we have not detected trend
38+
discontinuities as a result of the error. We will continue to investigate.
39+
40+
## Response Volume Drop (July 20-22, 2021)
41+
42+
On July 20, 2021, a technical problem in the process that samples Facebook users
43+
for invitation to the survey caused lower-than-normal sample sizes. The problem
44+
was resolved on July 22 and users that had been incorrectly not invited were
45+
invited over the following several days. This caused sample sizes to temporarily
46+
increase, compensating for the initial drop.
47+
48+
## Android Sampling Problem (June 17-24, 2021)
49+
50+
There was a bug in the in-app web browser in the Android version of the Facebook
51+
app released on June 17. It affected all links within the Android version of the
52+
Facebook app, not just the Carnegie Mellon University (CMU) and University of
53+
Maryland (UMD) COVID-19 Trends and Impact Surveys, which are conducted in
54+
partnership with Facebook. It did not affect links within other versions of
55+
Facebook, including iOS. The issue has been fixed in the version of the Facebook
56+
app released on June 24.
57+
58+
The issue caused a decrease in total response volume across the CMU and Maryland
59+
surveys, since Android users who were invited could not take the surveys. As of
60+
June 26, 2021, 89.5% of the initial decrease in total response volume has been
61+
recovered. The response volume continued to recover as Android users updated to
62+
the fixed version of the Facebook app.
63+
2064
## Incorrect Coding in Documentation
2165

2266
We found a Qualtrics bug that affects the exported text of the survey (but not

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ pandas==1.2.3
77
scipy==1.6.2
88
tenacity==7.0.0
99
newrelic
10+
epiweeks==2.1.2

src/acquisition/covidcast/signal_dash_data_generator.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pandas as pd
1010

1111
from dataclasses import dataclass
12+
from epiweeks import Week
1213
from typing import List
1314

1415
# first party
@@ -17,7 +18,9 @@
1718
from delphi.epidata.acquisition.covidcast.logger import get_structured_logger
1819

1920

20-
LOOKBACK_DAYS_FOR_COVERAGE = 28
21+
LOOKBACK_DAYS_FOR_COVERAGE = 56
22+
BASE_COVIDCAST = covidcast.covidcast.Epidata.BASE_URL[:-len("api.php")] + "covidcast"
23+
COVERAGE_URL = f"{BASE_COVIDCAST}/coverage?format=csv&signal={{source}}:{{signal}}&days={LOOKBACK_DAYS_FOR_COVERAGE}"
2124

2225
@dataclass
2326
class DashboardSignal:
@@ -195,27 +198,23 @@ def get_latest_time_value_from_metadata(dashboard_signal, metadata):
195198
def get_coverage(dashboard_signal: DashboardSignal,
196199
metadata) -> List[DashboardSignalCoverage]:
197200
"""Get the most recent coverage for the signal."""
198-
latest_time_value = get_latest_time_value_from_metadata(
199-
dashboard_signal, metadata)
200-
start_day = latest_time_value - datetime.timedelta(days = LOOKBACK_DAYS_FOR_COVERAGE)
201-
latest_data = covidcast.signal(
202-
dashboard_signal.source,
203-
dashboard_signal.covidcast_signal,
204-
end_day = latest_time_value,
205-
start_day = start_day)
206-
latest_data_without_megacounties = latest_data[~latest_data['geo_value'].str.endswith(
207-
'000')]
208-
count_by_geo_type_df = latest_data_without_megacounties.groupby(
209-
['geo_type', 'data_source', 'time_value', 'signal']).size().to_frame(
210-
'count').reset_index()
201+
count_by_geo_type_df = pd.read_csv(
202+
COVERAGE_URL.format(source=dashboard_signal.source,
203+
signal=dashboard_signal.covidcast_signal))
204+
try:
205+
count_by_geo_type_df["time_value"] = count_by_geo_type_df["time_value"].apply(
206+
lambda x: pd.to_datetime(str(x), format="%Y%m%d"))
207+
except:
208+
count_by_geo_type_df["time_value"] = count_by_geo_type_df["time_value"].apply(
209+
lambda x: pd.to_datetime(Week(x // 100, x % 100).startdate()))
211210

212211
signal_coverage_list = []
213212

214213
for _, row in count_by_geo_type_df.iterrows():
215214
signal_coverage = DashboardSignalCoverage(
216215
signal_id=dashboard_signal.db_id,
217216
date=row['time_value'].date(),
218-
geo_type=row['geo_type'],
217+
geo_type='county',
219218
count=row['count'])
220219
signal_coverage_list.append(signal_coverage)
221220

src/client/delphi_epidata.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Epidata <- (function() {
1515
# API base url
1616
BASE_URL <- 'https://delphi.cmu.edu/epidata/api.php'
1717

18-
client_version <- '0.2.6'
18+
client_version <- '0.2.7'
1919

2020
# Helper function to cast values and/or ranges to strings
2121
.listitem <- function(value) {

src/client/delphi_epidata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
})(this, function (exports, fetchImpl, jQuery) {
2424
const BASE_URL = "https://delphi.cmu.edu/epidata/";
25-
const client_version = "0.2.6";
25+
const client_version = "0.2.7";
2626

2727
// Helper function to cast values and/or ranges to strings
2828
function _listitem(value) {

src/client/packaging/npm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "delphi_epidata",
33
"description": "Delphi Epidata API Client",
44
"authors": "Delphi Group",
5-
"version": "0.2.6",
5+
"version": "0.2.7",
66
"license": "MIT",
77
"homepage": "https://github.com/cmu-delphi/delphi-epidata",
88
"bugs": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .delphi_epidata import Epidata
22

33
name = 'delphi_epidata'
4-
__version__ = '0.2.6'
4+
__version__ = '0.2.7'

src/client/packaging/pypi/setup.py

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

66
setuptools.setup(
77
name="delphi_epidata",
8-
version="0.2.6",
8+
version="0.2.7",
99
author="David Farrow",
1010
author_email="dfarrow0@gmail.com",
1111
description="A programmatic interface to Delphi's Epidata API.",

src/server/_config.py

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

66
load_dotenv()
77

8-
VERSION = "0.2.6"
8+
VERSION = "0.2.7"
99

1010
MAX_RESULTS = int(10e6)
1111
MAX_COMPATIBILITY_RESULTS = int(3650)

0 commit comments

Comments
 (0)