Skip to content

Commit 42963a3

Browse files
authored
Merge branch 'main' into docs/survey-correction
2 parents 161eb68 + 2e716a0 commit 42963a3

File tree

93 files changed

+7606
-1905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+7606
-1905
lines changed

.bumpversion.cfg

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[bumpversion]
2+
current_version = 0.1.0
3+
commit = False
4+
tag = False
5+
6+
[bumpversion:file:src/server/_config.py]
7+
8+
[bumpversion:file:src/client/delphi_epidata.js]
9+
10+
[bumpversion:file:src/client/delphi_epidata.R]
11+
12+
[bumpversion:file:src/client/packaging/npm/package.json]
13+
14+
[bumpversion:file:src/client/packaging/pypi/setup.py]
15+
16+
[bumpversion:file:src/client/packaging/pypi/delphi_epidata/__init__.py]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
closes <!--list issues closed by this PR -->
2+
3+
**Prerequisites**:
4+
5+
- [ ] Unless it is a documentation hotfix it should be merged against the `dev` branch
6+
- [ ] Branch is up-to-date with the branch to be merged with, i.e. `dev`
7+
- [ ] Build is successful
8+
- [ ] Code is cleaned up and formatted
9+
10+
### Summary
11+
12+
<!--
13+
describe what this PR changes
14+
-->

.github/workflows/ci.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,27 @@ jobs:
8484
docker stop delphi_database_epidata delphi_web_epidata
8585
docker network remove delphi-net
8686
87+
build_js_clients:
88+
runs-on: ubuntu-latest
89+
defaults:
90+
run:
91+
working-directory: src/client/packaging/npm
92+
steps:
93+
- name: Checkout
94+
uses: actions/checkout@v2
95+
- uses: actions/setup-node@v2
96+
with:
97+
node-version: '14.x'
98+
- name: Cache Node.js modules
99+
uses: actions/cache@v2
100+
with:
101+
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
102+
key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }}
103+
restore-keys: |
104+
${{ runner.OS }}-node2-
105+
- run: npm ci
106+
- run: npm test
107+
87108
image:
88109
needs: build
89110
# only on main and dev branch
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Create Delphi Epidata Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
versionName:
7+
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
8+
required: true
9+
default: patch
10+
11+
jobs:
12+
create_release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v2
17+
with:
18+
ref: main
19+
ssh-key: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_SSH }}
20+
- name: Reset dev branch
21+
run: |
22+
git fetch origin dev:dev
23+
git reset --hard dev
24+
- name: Set up Python 3.8
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.8
28+
- name: Change version number
29+
id: version
30+
run: |
31+
python -m pip install bump2version
32+
echo -n "::set-output name=next_tag::"
33+
bump2version --list ${{ github.event.inputs.versionName }} | grep new_version | sed -r s,"^.*=",,
34+
- name: Create pull request into prod
35+
uses: peter-evans/create-pull-request@v3
36+
with:
37+
branch: release/delphi-epidata-${{ steps.version.outputs.next_tag }}
38+
commit-message: 'chore: release delphi-epidata ${{ steps.version.outputs.next_tag }}'
39+
base: main
40+
title: Release Delphi Epidata ${{ steps.version.outputs.next_tag }}
41+
labels: chore
42+
reviewers: krivard
43+
assignees: krivard
44+
body: |
45+
Releasing Delphi Epidata ${{ steps.version.outputs.next_tag }}.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ __pycache__/
55
/.env
66
*.db
77
/build
8-
/node_modules
8+
/node_modules
9+
.mypy_cache

deploy.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,12 @@
1010
"actions": [
1111

1212
"// client - API",
13-
{
14-
"type": "minimize-js",
15-
"src": "src/client/delphi_epidata.js",
16-
"dst": "src/client/delphi_epidata.min.js"
17-
},
1813
{
1914
"type": "copy",
2015
"src": "src/client/delphi_epidata.py",
2116
"dst": "[[package]]/client/delphi_epidata.py",
2217
"add-header-comment": true
2318
},
24-
{
25-
"type": "move",
26-
"src": "src/client/",
27-
"dst": "[[root_web]]/lib/",
28-
"match": "^delphi_epidata.*\\.(js|py|coffee|R)$",
29-
"add-header-comment": true
30-
},
31-
32-
"// server - API (note: glob doesn't include dotfiles)",
33-
{
34-
"type": "move",
35-
"src": "src/server/",
36-
"dst": "[[root_web]]",
37-
"match": "^.*\\.(html|php)$",
38-
"add-header-comment": true
39-
},
40-
{
41-
"type": "move",
42-
"src": "src/server/.htaccess",
43-
"dst": "[[root_web]]/.htaccess",
44-
"add-header-comment": true
45-
},
4619

4720
"// server",
4821
{

docs/api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Please note that our `endpoint` parameters were previously referenced as `source
7070

7171
# The API
7272

73-
The base URL is: https://delphi.cmu.edu/epidata/api.php
73+
The base URL is: https://delphi.cmu.edu/epidata/
7474

7575
## Specifying Epiweeks, Dates, and Lists
7676

@@ -154,7 +154,7 @@ The parameters available for each source are documented in each linked source-sp
154154
# Example URLs
155155

156156
### FluView on 2015w01 (national)
157-
https://delphi.cmu.edu/epidata/api.php?endpoint=fluview&regions=nat&epiweeks=201501
157+
https://delphi.cmu.edu/epidata/fluview/?regions=nat&epiweeks=201501
158158

159159
```json
160160
{
@@ -184,7 +184,7 @@ https://delphi.cmu.edu/epidata/api.php?endpoint=fluview&regions=nat&epiweeks=201
184184
```
185185

186186
### Wikipedia Access article "influenza" on 2020w01
187-
https://delphi.cmu.edu/epidata/api.php?endpoint=wiki&language=en&articles=influenza&epiweeks=202001
187+
https://delphi.cmu.edu/epidata/wiki/?language=en&articles=influenza&epiweeks=202001
188188

189189
```json
190190
{

docs/api/afhsb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ General topics not specific to any particular endpoint are discussed in the
1919

2020
# The API
2121

22-
The base URL is: https://delphi.cmu.edu/epidata/api.php
22+
The base URL is: https://delphi.cmu.edu/epidata/afhsb/
2323

2424
See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
2525

docs/api/cdc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ General topics not specific to any particular endpoint are discussed in the
1919

2020
# The API
2121

22-
The base URL is: https://delphi.cmu.edu/epidata/api.php
22+
The base URL is: https://delphi.cmu.edu/epidata/cdc/
2323

2424
See [this documentation](README.md) for details on specifying epiweeks, dates, and lists.
2525

docs/api/client_libraries.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ nav_order: 1
77
# Epidata API Client Libraries.
88

99
Epidata clients are available for
10-
[CoffeeScript](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.coffee),
1110
[JavaScript](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.js),
1211
[Python](https://github.com/cmu-delphi/delphi-epidata/blob/master/src/client/delphi_epidata.py),
1312
and
@@ -18,29 +17,16 @@ Surveillance Streams from Facebook Survey CLI for county 06001 and days
1817

1918
For anyone looking for COVIDCast data, please visit our [COVIDCast Libraries](covidcast_clients.md).
2019

21-
### CoffeeScript (in Node.js)
22-
23-
````coffeescript
24-
# Import
25-
{Epidata} = require('./delphi_epidata')
26-
# Fetch data
27-
callback = (result, message, epidata) ->
28-
console.log(result, message, epidata?.length)
29-
Epidata.covidcast(callback, 'fb-survey', 'smoothed_cli', 'day', 'county', [20200401, Epidata.range(20200405, 20200414)], '06001')
30-
````
31-
3220
### JavaScript (in a web browser)
3321

3422
````html
3523
<!-- Imports -->
36-
<script src="jquery.js"></script>
3724
<script src="delphi_epidata.js"></script>
3825
<!-- Fetch data -->
3926
<script>
40-
var callback = function(result, message, epidata) {
41-
console.log(result, message, epidata != null ? epidata.length : void 0);
42-
};
43-
Epidata.covidcast(callback, 'fb-survey', 'smoothed_cli', 'day', 'county', [20200401, Epidata.range(20200405, 20200414)], '06001');
27+
EpidataAsync.covidcast('fb-survey', 'smoothed_cli', 'day', 'county', [20200401, EpidataAsync.range(20200405, 20200414)], '06001').then((res) => {
28+
console.log(res.result, res.message, res.epidata != null ? res.epidata.length : 0);
29+
});
4430
</script>
4531
````
4632

docs/api/covid_hosp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ parent: Epidata API (Other Diseases)
66
# COVID-19 Hospitalization by State
77

88
This data source is a mirror of the "COVID-19 Reported Patient Impact and
9-
Hospital Capacity by State Timeseries" and "COVID-19 Reported Patient Impact and
9+
Hospital Capacity by State Timeseries" and "COVID-19 Reported Patient Impact and
1010
Hospital Capacity by State" datasets provided by the US Department of
1111
Health & Human Services via healthdata.gov. The latter provides more frequent updates,
1212
so it is combined with the former to create a single dataset which is as recent as possible.
1313

1414
For more information, see the
1515
[official description and data dictionary at healthdata.gov](https://healthdata.gov/Hospital/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/g62h-syeh)
16-
for "COVID-19 Reported Patient Impact and Hospital Capacity by State Timeseries,"
16+
for "COVID-19 Reported Patient Impact and Hospital Capacity by State Timeseries,"
1717
as well as the [official description](https://healthdata.gov/dataset/COVID-19-Reported-Patient-Impact-and-Hospital-Capa/6xf2-c3ie)
1818
for "COVID-19 Reported Patient Impact and Hospital Capacity by State."
1919

@@ -72,7 +72,7 @@ If `issues` is not specified, then the most recent issue is used by default.
7272
# Example URLs
7373

7474
### MA on 2020-05-10 (per most recent issue)
75-
https://delphi.cmu.edu/epidata/api.php?endpoint=covid_hosp&states=MA&dates=20200510
75+
https://delphi.cmu.edu/epidata/covid_hosp/?states=MA&dates=20200510
7676

7777
```json
7878
{
@@ -143,7 +143,7 @@ https://delphi.cmu.edu/epidata/api.php?endpoint=covid_hosp&states=MA&dates=20200
143143

144144
# Code Samples
145145

146-
Libraries are available for [CoffeeScript](../../src/client/delphi_epidata.coffee), [JavaScript](../../src/client/delphi_epidata.js), [Python](../../src/client/delphi_epidata.py), and [R](../../src/client/delphi_epidata.R).
146+
Libraries are available for [JavaScript](../../src/client/delphi_epidata.js), [Python](../../src/client/delphi_epidata.py), and [R](../../src/client/delphi_epidata.R).
147147
The following sample shows how to import the library and fetch MA on 2020-05-10
148148
(per most recent issue).
149149

docs/api/covid_hosp_facility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ HHS. New versions are expected to be published roughly weekly.
3030

3131
# The API
3232

33-
The base URL is: https://delphi.cmu.edu/epidata/api.php
33+
The base URL is: https://delphi.cmu.edu/epidata/covid_hosp_facility/
3434

3535
See [this documentation](README.md) for details on specifying locations and dates.
3636

@@ -80,7 +80,7 @@ has been renamed here for clarity.
8080
# Example URLs
8181

8282
### Moses Taylor Hospital (Scranton, PA) on the first collection week of December 2020 (per most recent issue)
83-
https://delphi.cmu.edu/epidata/api.php?source=covid_hosp_facility&hospital_pks=390119&collection_weeks=20201201-20201207
83+
https://delphi.cmu.edu/epidata/covid_hosp_facility/?hospital_pks=390119&collection_weeks=20201201-20201207
8484

8585
```json
8686
{
@@ -190,7 +190,7 @@ https://delphi.cmu.edu/epidata/api.php?source=covid_hosp_facility&hospital_pks=3
190190

191191
# Code Samples
192192

193-
Libraries are available for [CoffeeScript](../../src/client/delphi_epidata.coffee), [JavaScript](../../src/client/delphi_epidata.js), [Python](../../src/client/delphi_epidata.py), and [R](../../src/client/delphi_epidata.R).
193+
Libraries are available for [JavaScript](../../src/client/delphi_epidata.js), [Python](../../src/client/delphi_epidata.py), and [R](../../src/client/delphi_epidata.R).
194194
The following sample shows how to import the library and fetch Moses Taylor
195195
Hospital (Scranton, PA) on the first collection week of December 2020 (per most
196196
recent issue).

docs/api/covid_hosp_facility_lookup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This data source provides metadata about healthcare facilities in the US.
3030

3131
# The API
3232

33-
The base URL is: https://delphi.cmu.edu/epidata/api.php?source=covid_hosp_facility_lookup
33+
The base URL is: https://delphi.cmu.edu/epidata/covid_hosp_facility_lookup/
3434

3535
See [this documentation](README.md) for details on specifying locations and dates.
3636

@@ -61,7 +61,7 @@ supported.
6161
# Example URLs
6262

6363
### Lookup facilities in the city of Southlake (TX)
64-
https://delphi.cmu.edu/epidata/api.php?source=covid_hosp_facility_lookup&city=southlake
64+
https://delphi.cmu.edu/epidata/covid_hosp_facility_lookup/?city=southlake
6565

6666
```json
6767
{
@@ -99,7 +99,7 @@ https://delphi.cmu.edu/epidata/api.php?source=covid_hosp_facility_lookup&city=so
9999

100100
# Code Samples
101101

102-
Libraries are available for [CoffeeScript](../../src/client/delphi_epidata.coffee), [JavaScript](../../src/client/delphi_epidata.js), [Python](../../src/client/delphi_epidata.py), and [R](../../src/client/delphi_epidata.R).
102+
Libraries are available for [JavaScript](../../src/client/delphi_epidata.js), [Python](../../src/client/delphi_epidata.py), and [R](../../src/client/delphi_epidata.R).
103103
The following sample shows how to import the library and fetch facilities in
104104
the city of Southlake (TX).
105105

docs/api/covidcast-signals/ght.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ arbitrary units (its scale is meaningless); larger numbers represent higher
2323
numbers of COVID-related searches.
2424

2525
These signals were updated daily until March 8, 2021. After that date, Google
26-
dropped support for Google Health Trends access. We recommend the [Google
27-
Symptoms source](google-symptoms.md) as an alternative, which provides
26+
dropped support for Google Health Trends access. We recommend the
27+
[Google Symptoms source](google-symptoms.md) as an alternative, which provides
2828
finer-grained measures of search volume at the symptom level.
2929

3030
| Signal | Description |

docs/api/covidcast-signals/hhs.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ resource usage in different ways.
2727
This indicator makes available several commonly-used combinations of
2828
those columns, aggregated geographically. In particular, we include
2929
the sum of all adult and pediatric COVID-19 hospital admissions. This
30-
sum is used as the "ground truth" for hospitalizations by the [COVID-19
31-
Forecast Hub](https://github.com/reichlab/covid19-forecast-hub/blob/master/data-processed/README.md#hospitalizations).
30+
sum is used as the "ground truth" for hospitalizations by the [COVID-19 Forecast Hub](https://github.com/reichlab/covid19-forecast-hub/blob/master/data-processed/README.md#hospitalizations).
3231

3332

3433
| Signal | Geography | Resolution | Description |
@@ -51,7 +50,7 @@ the HHS state timeseries dataset:
5150

5251
* `previous_day_admission_[adult|pediatric]_covid_[confirmed|suspected]`
5352

54-
The `confirmed` signal is the sum of the two `confirmed` columns:
53+
The `confirmed` signal is the sum of the two `confirmed` columns:
5554

5655
* adult
5756
* pediatric
@@ -95,6 +94,6 @@ published by the U.S. Department of Health & Human Services under an
9594
[Open Data Commons Open Database License
9695
(ODbL)](https://opendatacommons.org/licenses/odbl/1-0/). The ODbL
9796
permits sharing, transformation, and redistribution of data or derived
98-
works so long as all public uses are distributed under the ODbL and
97+
works so long as all public uses are distributed under the ODbL and
9998
attributed to the source. For more details, consult the official
10099
license text.

docs/api/covidcast-signals/indicator-combination.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ calculated or composed by Delphi. It is not a primary data source.
2121
## Statistical Combination Signals (Inactive)
2222

2323
The NMF combination signals were deactivated on March 17, 2021. Documentation for
24-
these signals is still available on the page for [inactive indicator-combination
25-
signals](indicator-combination-inactive.md).
24+
these signals is still available on the page for
25+
[inactive indicator-combination signals](indicator-combination-inactive.md).
2626

2727
## Compositional Signals: Confirmed Cases and Deaths
2828

docs/api/covidcast-signals/nchs-mortality.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ grand_parent: COVIDcast Epidata API
1818
This data source of national provisional death counts is based on death
1919
certificate data received and coded by the National Center for Health Statistics
2020
[(NCHS)](https://www.cdc.gov/nchs/nvss/vsrr/COVID19/index.htm). This data is
21-
different from the death data available from [USAFacts](usa-facts.md) and [JHU
22-
CSSE](jhu-csse.md): deaths are reported by the date they occur, not the date
21+
different from the death data available from [USAFacts](usa-facts.md) and
22+
[JHU CSSE](jhu-csse.md): deaths are reported by the date they occur, not the date
2323
they are reported by local health departments, and data is frequently reissued
2424
as additional death certificates from recent weeks are received and tabulated.
2525

0 commit comments

Comments
 (0)