Skip to content

Commit 6360508

Browse files
authored
Merge branch 'dev' into nsspDocs
2 parents 889abe1 + 69835d1 commit 6360508

File tree

18 files changed

+2456
-548
lines changed

18 files changed

+2456
-548
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.1.20
2+
current_version = 4.1.23
33
commit = False
44
tag = False
55

@@ -9,10 +9,10 @@ tag = False
99

1010
[bumpversion:file:src/client/delphi_epidata.R]
1111

12+
[bumpversion:file:src/client/delphi_epidata.py]
13+
1214
[bumpversion:file:src/client/packaging/npm/package.json]
1315

1416
[bumpversion:file:src/client/packaging/pypi/setup.py]
1517

16-
[bumpversion:file:src/client/packaging/pypi/delphi_epidata/__init__.py]
17-
1818
[bumpversion:file:dev/local/setup.cfg]

dev/local/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = Delphi Development
3-
version = 4.1.20
3+
version = 4.1.23
44

55
[options]
66
packages =

docs/Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ GEM
225225
rb-fsevent (0.10.4)
226226
rb-inotify (0.10.1)
227227
ffi (~> 1.0)
228-
rexml (3.2.5)
228+
rexml (3.2.8)
229+
strscan (>= 3.0.9)
229230
rouge (3.26.0)
230231
ruby-enum (0.9.0)
231232
i18n
@@ -242,6 +243,7 @@ GEM
242243
faraday (> 0.8, < 2.0)
243244
simpleidn (0.2.1)
244245
unf (~> 0.1.4)
246+
strscan (3.1.0)
245247
terminal-table (1.8.0)
246248
unicode-display_width (~> 1.1, >= 1.1.1)
247249
thread_safe (0.3.6)

docs/api/client_libraries.md

Lines changed: 56 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,81 @@ nav_order: 1
66

77
# Epidata API Client Libraries
88

9-
For anyone looking for COVIDCast data, please visit our [COVIDCast Libraries](covidcast_clients.md).
9+
To access Delphi Epidata programmatically, we recommend our client libraries:
1010

11-
We are currently working on fully-featured Epidata clients for R and Python. They are not ready
12-
for release yet, but you can track our development progress and help us test them out at:
11+
- R: [epidatr](https://cmu-delphi.github.io/epidatr/),
12+
- Python: [delphi-epidata](https://pypi.org/project/delphi-epidata/) (soon to be replaced with [epidatpy](https://github.com/cmu-delphi/epidatpy)),
13+
- Javascript: [delphi-epidata](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js).
1314

14-
* [epidatr](https://github.com/cmu-delphi/epidatr)
15-
* [epidatpy](https://github.com/cmu-delphi/epidatpy)
15+
For anyone looking for COVIDCast data, please visit our [COVIDCast Libraries](covidcast_clients.md).
1616

17-
In the meantime, minimalist Epidata clients remain available for
18-
[JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js),
19-
[Python](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py),
20-
and
21-
[R](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.R).
22-
The following samples show how to import the library and fetch Delphi's COVID-19
23-
Surveillance Streams from Facebook Survey CLI for county 06001 and days
17+
The following samples show how to import the library and fetch Delphi's
18+
COVID-19 Surveillance Streams from Facebook Survey CLI for county 06001 and days
2419
`20200401` and `20200405-20200414` (11 days total).
2520

26-
### JavaScript (in a web browser)
21+
### R
2722

28-
The minimalist JavaScript client does not currently support API keys. If you need API key support in JavaScript, contact [email protected].
23+
Install [`epidatr` from CRAN](https://cran.r-project.org/package=epidatr)
24+
with `install.packages("epidatr")`.
2925

30-
````html
31-
<!-- Imports -->
32-
<script src="delphi_epidata.js"></script>
33-
<!-- Fetch data -->
34-
<script>
35-
EpidataAsync.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401, EpidataAsync.range(20200405, 20200414)], '06001').then((res) => {
36-
console.log(res.result, res.message, res.epidata != null ? res.epidata.length : 0);
37-
});
38-
</script>
39-
````
26+
```R
27+
# Configure API key interactively, if needed. See
28+
# https://cmu-delphi.github.io/epidatr/articles/epidatr.html#api-keys for details.
29+
#save_api_key()
30+
library(epidatr)
31+
res <- pub_covidcast('fb-survey', 'smoothed_cli', 'county', 'day', geo_values = '06001',
32+
time_values = c(20200401, 20200405:20200414))
33+
cat(res)
34+
```
4035

4136
### Python
4237

38+
Install [`delphi-epidata` from PyPI](https://pypi.org/project/delphi-epidata/) with
39+
`pip install delphi-epidata`.
4340

44-
Optionally install the [package from PyPI](https://pypi.org/project/delphi-epidata/) using pip(env):
45-
````bash
46-
pip install delphi-epidata
47-
````
48-
49-
Otherwise, place
50-
[`delphi_epidata.py`](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py)
51-
in the same directory as your Python script.
52-
53-
````python
54-
# Import
41+
```python
5542
from delphi_epidata import Epidata
56-
# [Optional] configure your API key, if desired
43+
# Configure API key, if needed.
5744
#Epidata.auth = ('epidata', <your API key>)
58-
# Fetch data
5945
res = Epidata.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401, Epidata.range(20200405, 20200414)], '06001')
6046
print(res['result'], res['message'], len(res['epidata']))
61-
````
47+
```
6248

63-
### R
49+
### JavaScript (in a web browser)
50+
51+
The minimalist JavaScript client does not currently support API keys.
52+
If you need API key support in JavaScript, contact [email protected].
53+
54+
```html
55+
<script src="delphi_epidata.js"></script>
56+
<script>
57+
EpidataAsync.covidcast(
58+
"fb-survey",
59+
"smoothed_cli",
60+
"day",
61+
"county",
62+
[20200401, EpidataAsync.range(20200405, 20200414)],
63+
"06001"
64+
).then((res) => {
65+
console.log(
66+
res.result,
67+
res.message,
68+
res.epidata != null ? res.epidata.length : 0
69+
);
70+
});
71+
</script>
72+
```
73+
74+
### R (legacy)
6475

76+
The old Delphi Epidata R client is available
77+
[here](https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/delphi_epidata.R),
78+
but its use is discouraged.
6579

66-
````R
67-
# [Optional] configure your API key, if desired
80+
```R
81+
# Configure API key, if needed.
6882
#option('epidata.auth', <your API key>)
69-
# Import
7083
source('delphi_epidata.R')
71-
# Fetch data
7284
res <- Epidata$covidcast('fb-survey', 'smoothed_cli', 'day', 'county', list(20200401, Epidata$range(20200405, 20200414)), '06001')
7385
cat(paste(res$result, res$message, length(res$epidata), "\n"))
74-
````
86+
```

docs/api/covidcast_clients.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ nav_order: 1
66

77
# COVIDcast Libraries
88

9-
Dedicated COVIDcast access and analysis libraries are available for several languages:
9+
To access COVIDcast data, we recommend using the following client libraries:
1010

11-
* R: [covidcast](https://cmu-delphi.github.io/covidcast/covidcastR/)
12-
* Python: [covidcast](https://cmu-delphi.github.io/covidcast/covidcast-py/html/)
11+
- R: [epidatr](https://cmu-delphi.github.io/epidatr/),
12+
- Python: [covidcast](https://cmu-delphi.github.io/covidcast/covidcast-py/html/) (soon to be replaced with [epidatpy](https://github.com/cmu-delphi/epidatpy)).
1313

1414
These packages provide a convenient way to obtain COVIDcast data as a data frame
15-
ready to be used in further analyses and provide convenient mapping and
16-
analysis functions. For installation instructions and examples, consult their
17-
respective webpages.
15+
ready to be used in further analyses and provide convenient mapping and analysis
16+
functions. For installation instructions and examples, consult their respective
17+
webpages.
1818

19-
20-
To access Epidata datasets on other diseases, visit our [Epidata API Client Libraries)](client_libraries.md) documentation.
19+
To access Epidata datasets on other diseases, visit our
20+
[Epidata API Client Libraries](client_libraries.md) documentation.

docs/symptom-survey/publications.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ Pandemic"](https://www.pnas.org/topic/548) in *PNAS*:
2626

2727
Research publications using the survey data include:
2828

29+
- Y. Yang, W. Dempsey, P. Han, Y. Deshmukh, S. Richardson, B. Tom, and B. Mukherjee
30+
(2024). [Exploring the Big Data Paradox for various estimands using vaccination
31+
data from the global COVID-19 Trends and Impact Survey (CTIS)](https://doi.org/10.1126/sciadv.adj0266).
32+
*Science Advances* 10 (22).
33+
- Perofsky, A.C., Hansen, C.L., Burstein, R. et al (2024). [Impacts of human
34+
mobility on the citywide transmission dynamics of 18 respiratory viruses
35+
in pre- and post-COVID-19 pandemic years](https://doi.org/10.1038/s41467-024-48528-2).
36+
*Nature Communications* 15, 4164.
37+
- Z. Yang, R. Krishnan, and B. Li (2024). [The interplay between individual
38+
mobility, health risk, and economic choice: A holistic model for COVID-19
39+
policy intervention](https://doi.org/10.1287/ijds.2023.0013). *INFORMS
40+
Journal on Data Science*.
2941
- A. Srivastava, J. M. Ramirez, S. Díaz-Aranda, J. Aguilar, A. F. Anta, A. Ortega,
3042
and R. E. Lillo (2024). [Nowcasting temporal trends using indirect surveys](https://doi.org/10.1609/aaai.v38i20.30242).
3143
In *Proceedings of the 38th AAAI Conference on Artificial Intelligence* 38,

requirements.api.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
delphi_utils==0.3.15
1+
delphi_utils
22
epiweeks==2.1.2
33
Flask==2.2.5
44
Flask-Limiter==3.3.0
@@ -10,7 +10,7 @@ pandas==1.2.3
1010
python-dotenv==0.15.0
1111
pyyaml
1212
redis==3.5.3
13-
requests==2.31.0
13+
requests==2.32.0
1414
scipy==1.10.0
1515
sentry-sdk[flask]
1616
SQLAlchemy==1.4.40

requirements.dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ aiohttp==3.9.4
22
black>=20.8b1
33
bump2version==1.0.1
44
covidcast==0.1.5
5-
delphi_utils==0.3.15
5+
delphi_utils
66
docker==6.0.1
77
dropbox==11.36.0
88
freezegun==1.2.2
@@ -13,7 +13,6 @@ mypy>=0.790
1313
mysql-connector==2.2.9
1414
numpy==1.22.4
1515
pycountry==22.3.5
16-
pymysql==1.0.2
1716
pytest==7.2.0
1817
pytest-check==1.3.0
1918
sas7bdat==2.2.3

0 commit comments

Comments
 (0)