Skip to content

Commit 628e965

Browse files
authored
Merge branch 'dev' into ds/docs2
2 parents fe51f39 + f8f760f commit 628e965

File tree

19 files changed

+989
-478
lines changed

19 files changed

+989
-478
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ tag = False
99

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

12-
[bumpversion:file:src/client/delphi_epidata.py]
13-
1412
[bumpversion:file:src/client/packaging/npm/package.json]
1513

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

.github/workflows/create-release.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
versionName:
7-
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major, prepatch, preminor, premajor, prerelease)'
7+
description: 'Semantic Version Number (i.e., 5.5.0 or patch, minor, major)'
88
required: true
99
default: patch
1010

@@ -27,11 +27,43 @@ jobs:
2727
python-version: 3.8
2828
- name: Change version number
2929
id: version
30+
# See this issue for explanation and testing:
31+
# https://github.com/cmu-delphi/delphi-epidata/pull/1473
3032
run: |
3133
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
34+
if [[ ${{ github.event.inputs.versionName }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
35+
# use given version number
36+
NEXT_TAG="${{ github.event.inputs.versionName }}"
37+
elif [[ ${{ github.event.inputs.versionName }} =~ ^(major|minor|patch)$ ]]; then
38+
# calculate new version number based on given tag
39+
NEXT_TAG=$(bump2version --dry-run --list ${{ github.event.inputs.versionName }} | grep ^new_version | sed -r s,"^.*=",,)
40+
else
41+
echo "\nInvalid version name: ${{ github.event.inputs.versionName }}"
42+
exit 1
43+
fi
44+
# apply given or calculated version number
45+
bump2version --new-version $NEXT_TAG _ignored_arg_
46+
# save version number for later
47+
echo "next_tag=$NEXT_TAG" >> $GITHUB_OUTPUT
48+
- name: Get Python client file changes
49+
id: changed-py
50+
uses: dorny/paths-filter@v3
51+
with:
52+
base: "main"
53+
ref: "dev"
54+
filters: |
55+
python_client_changed:
56+
- src/client/delphi_epidata.py
57+
- src/client/packaging/pypi/**
58+
- name: Bump Python versions if client files changed
59+
if: steps.changed-py.outputs.python_client_changed == 'true'
60+
# _ignored_arg_ below is required because of tool quirk
61+
# https://github.com/c4urself/bump2version/issues/22
62+
run: |
63+
cd src/client/packaging/pypi
64+
# this is using the new literal version number (steps.version.outputs.next_tag) output from the bump2version step above, not the workflow input (github.event.inputs.versionName) which can be relative
65+
bump2version --allow-dirty --new-version ${{ steps.version.outputs.next_tag }} _ignored_arg_
66+
- name: Create pull request into main
3567
uses: peter-evans/create-pull-request@v3
3668
with:
3769
branch: release/delphi-epidata-${{ steps.version.outputs.next_tag }}

.github/workflows/release-helper.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@ jobs:
1313
if: github.repository_owner != 'cmu-delphi'
1414
run: exit 1
1515

16+
client_changed:
17+
needs: correct_repository
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 2
24+
- name: Get Python client file changes
25+
id: changed-py
26+
uses: dorny/paths-filter@v3
27+
with:
28+
# when base and ref are the same, changes are detected against the most recent commit before the push.
29+
# see https://github.com/dorny/paths-filter#usage for details.
30+
base: 'main'
31+
ref: 'main'
32+
filters: |
33+
python_client_changed:
34+
- src/client/delphi_epidata.py
35+
- src/client/packaging/pypi/**
36+
outputs:
37+
python_client_changed: ${{ steps.changed-py.outputs.python_client_changed }}
38+
1639
create_release:
1740
needs: correct_repository
1841
runs-on: ubuntu-latest
@@ -29,8 +52,8 @@ jobs:
2952
id: extract_version
3053
run: |
3154
python -m pip install bump2version
32-
echo -n "::set-output name=version::"
33-
bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,
55+
VERSION=$(bump2version --dry-run --list patch | grep ^current_version | sed -r s,"^.*=",,)
56+
echo "version=$VERSION" >> $GITHUB_OUTPUT
3457
- name: Create Release
3558
id: create_release
3659
uses: release-drafter/release-drafter@v5
@@ -45,7 +68,8 @@ jobs:
4568
tag_name: ${{ steps.create_release.outputs.tag_name }}
4669

4770
release_python_client:
48-
needs: create_release
71+
needs: [client_changed, create_release]
72+
if: needs.client_changed.outputs.python_client_changed == 'true'
4973
runs-on: ubuntu-latest
5074
steps:
5175
- name: Check out code
@@ -57,14 +81,14 @@ jobs:
5781
- name: Install build dependencies
5882
run: |
5983
python -m pip install --upgrade pip
60-
pip install wheel twine
84+
pip install build wheel twine
6185
- name: Prepare package
6286
run: |
6387
cp src/client/*.py src/client/packaging/pypi/delphi_epidata/
6488
- name: Create release
6589
working-directory: src/client/packaging/pypi
6690
run: |
67-
python setup.py sdist bdist_wheel
91+
python -m build --sdist --wheel
6892
- uses: actions/upload-artifact@v2
6993
with:
7094
name: delphi_epidata_py
@@ -80,8 +104,8 @@ jobs:
80104
with:
81105
user: __token__
82106
password: ${{ secrets.DELPHI_PYPI_PROD_TOKEN }}
83-
packages_dir: src/client/packaging/pypi/dist/
84-
skip_existing: true
107+
packages-dir: src/client/packaging/pypi/dist/
108+
skip-existing: true
85109
# repository_url: https://test.pypi.org/legacy/
86110

87111
release_js_client:
@@ -95,7 +119,7 @@ jobs:
95119
uses: actions/checkout@v2
96120
- uses: actions/setup-node@v2
97121
with:
98-
node-version: '16.x'
122+
node-version: "16.x"
99123
- name: Cache Node.js modules
100124
uses: actions/cache@v2
101125
with:

docs/api/covidcast-signals/indicator-combination-inactive.md renamed to docs/api/covidcast-signals/indicator-combination

File renamed without changes.

docs/api/covidcast-signals/nssp.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: NSSP ED Visits
3+
parent: Data Sources and Signals
4+
grand_parent: COVIDcast Main Endpoint
5+
---
6+
# National Syndromic Surveillance Program Emergency Department Visits
7+
{: .no_toc}
8+
9+
* **Source name:** `nssp`
10+
* **Earliest issue available:** April 17, 2024
11+
* **Number of data revisions since 19 May 2020:** 0
12+
* **Date of last change:** Never
13+
* **Available for:** county, hrr, msa, state, nation (see [geography coding docs](../covidcast_geography.md))
14+
* **Time type:** week (see [date format docs](../covidcast_times.md))
15+
* **License:** [Public Domain US Government](https://www.usa.gov/government-works)
16+
17+
## Overview
18+
19+
[The National Syndromic Surveillance Program (NSSP)](https://www.cdc.gov/nssp/php/about/index.html) is an effort to track epidemiologically relevant conditions.
20+
This dataset in particular tracks emergency department (ED) visits arising from a subset of influenza-like illnesses, specifically influenza, COVID-19, and respiratory syncytial virus (RSV).
21+
It is derived from the CDC's [Respiratory Virus Response NSSP Emergency Department Visit Trajectories dataset](https://data.cdc.gov/Public-Health-Surveillance/2023-Respiratory-Virus-Response-NSSP-Emergency-Dep/rdmq-nq56/about_data), which started reporting data in late 2022.
22+
As of May 2024, NSSP received data from 78% of US EDs.
23+
24+
| Signal | Description |
25+
|---------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
26+
| `pct_ed_visits_covid` | Percent of ED visits that had a discharge diagnosis code of COVID-19 <br/> **Earliest date available:** 2022-10-01 |
27+
| `pct_ed_visits_influenza` | Percent of ED visits that had a discharge diagnosis code of influenza <br/> **Earliest date available:** 2022-10-01 |
28+
| `pct_ed_visits_rsv` | Percent of ED visits that had a discharge diagnosis code of rsv <br/> **Earliest date available:** 2022-10-01 |
29+
| `pct_ed_visits_combined` | Percent of ED visits that had a discharge diagnosis code of COVID-19, influenza, or rsv <br/> **Earliest date available:** 2022-10-01 |
30+
| `smoothed_pct_ed_visits_covid` | 3 week moving average of `pct_ed_visits_covid` <br/> **Earliest date available:** 2022-10-01 |
31+
| `smoothed_pct_ed_visits_influenza` | 3 week moving average of `pct_ed_visits_influenza` <br/> **Earliest date available:** 2022-10-01 |
32+
| `smoothed_pct_ed_visits_rsv` | 3 week moving average of `pct_ed_visits_rsv` <br/> **Earliest date available:** 2022-10-01 |
33+
| `smoothed_pct_ed_visits_combined` | 3 week moving average of `pct_ed_visits_combined` <br/> **Earliest date available:** 2022-10-01 |
34+
35+
## Table of Contents
36+
{: .no_toc .text-delta}
37+
38+
1. TOC
39+
{:toc}
40+
41+
## Estimation
42+
43+
The percent visits signals are calculated as a fraction of visits at facilities reporting to NSSP, rather than all facilities in the area.
44+
County and state level data is reported as-is from NSSP, without modification, while `hrr` and `msa` are estimated by Delphi.
45+
46+
### Geographic weighting
47+
As the original data is a percentage and raw case counts are not available, `hrr` and `msa` values are computed from county-level data using a weighted mean. Each county is assigned a weight equal to its population in the last census (2020). Unreported counties are implicitly treated as having a weight of 0 or a value equal to the group mean.
48+
49+
This weighting approach assumes that the number of ED visits is proportional to the overall population of a county, i.e. the per-capita ED visit rate is the same for all counties, which may not be the case (for example, denser counties may have easier access to EDs and thus higher rates of ED visits per capita).
50+
51+
State reporting process is separate from the county reporting process. As such, state-level data is **not** simply an average of the county-level data, but may contain facilities omitted at the regional level. For example, state-level values are available for California, even though no California county data is reported; see the [missingness section below](#missingness) for a list of such states.
52+
53+
### Smoothing
54+
55+
Smoothed signals are calculated using a simple 3 week moving average of the relevant weekly signals. Note that since the unsmoothed `pct_ed_visits_*` signals report weekly data, each smoothed signal value is computed from 3 points rather than 21, as would be used if the unsmoothed data were reported daily.
56+
57+
58+
## Missingness
59+
60+
As of May 2024, NSSP received data from 78% of US EDs.
61+
62+
[The NSSP site participation map](https://www.cdc.gov/nssp/media/images/2024/04/Participation-with-date.png) shows counties containing at least one reporting ED between January 2023 and April 2024.
63+
California, Colorado, Missouri, Oklahoma, and Virginia have the most noticeable gaps in coverage, with many counties in those states having either no eligible EDs or having no recently reported data in NSSP. However, most states have some counties that do not contain any reporting EDs.
64+
65+
NSSP does not report county-level data for all counties with reporting EDs; some reporting EDs are only included in state-level values.
66+
67+
The following states report no data through NSSP at the county level: CA, WA, AK, AZ, AL, CO, SD, ND, MO, AR, FL, OH, NH, CT, NJ.
68+
69+
South Dakota, Missouri, and territories report no data through NSSP at the state level.
70+
71+
72+
## Lag and Backfill
73+
74+
The weekly signal is reported on Friday mornings, adding data from the prior week.
75+
For example, on Friday, 2024-04-19, the source added new data from the week ending 2024-04-13.
76+
77+
This data source has frequent backfill, primarily arising from newly included EDs. When a new facility joins the reporting network, its historical data is added to the dataset, resulting in changes to historical values for every geographic level that ED is part of (county through nation). Because of this, the broadest geographic levels are more likely to be revised.
78+
79+
In previous revisions, we have noted changes to values dating back about 2 years.
80+
The following states have no county-level data at all: AK, AL, AR, AZ, CA, FL, MO, ND, NH, NJ, OH, SD, WA.
81+
Counties with `NA` values are as originally reported in the dataset from which this source is derived; this is not a complete list of counties, and reflects missing data as collected by the NSSP.
82+
83+
84+
## Limitations
85+
86+
There is substantial missingness at the county level. This tends to impact more rural and lower population locations. See the [missingness section](#missingness) for more information.
87+
88+
Not all counties contain reporting EDs, including in states where NSSP reports state-level data.
89+
A minority of these (as of June 2024) are counties without EDs, while others are only covered by the ~22% of EDs that don't yet report to the NSSP.
90+
91+
NSSP notes that not every patient entering an ED is tested for the conditions of interest, so the data may undercount total cases and as a result percent visits may be biased downward.
92+
93+
Our [geographic weighting approach](#geographic-weighting) assumes that the number of ED visits is proportional to the overall population of a county. However, in reality, there are various factors that could affect the accuracy of this assumption.
94+
95+
For example, we might expect denser, more urban counties to have 1) more and larger EDs and 2) easier access to EDs. The first factor may mean that residents of rural counties are more likely to go to EDs in urban counties. The second factor may increase the total number of ED visits that the typical urban resident will make relative to the typical rural resident.
96+
As a result, total ED visits per capita in rural counties may be lower than total ED visits per capita in urban counties. If this is a strong dynamic, since our weighting approach uses population as the weights, rural counties would tend to be overrepresented in estimated values.
97+
98+
Some low population counties occasionally report outliers, e.g. 33.33%, 50%, 100% of ER visits being COVID-19-related. We expect that these high rates are by chance, due to a small total number of ED visits in a given week. As of May 2024, an analysis shows around 10 unusually high values across the full history of all signals, so they are rare.
99+
100+
101+
## Source and Licensing
102+
103+
This source is derived from the CDC's [Respiratory Virus Response NSSP Emergency Department Visit Trajectories dataset](https://data.cdc.gov/Public-Health-Surveillance/2023-Respiratory-Virus-Response-NSSP-Emergency-Dep/rdmq-nq56/about_data).
104+
There is another version of the dataset that includes [state data only](https://data.cdc.gov/Public-Health-Surveillance/2023-Respiratory-Virus-Response-NSSP-Emergency-Dep/7mra-9cq9/about_data).
105+
106+
This data was originally published by the CDC, and is made available here as a convenience to the forecasting community under the terms of the original license, which is [U.S. Government Public Domain](https://www.usa.gov/government-copyright).
File renamed without changes.

docs/api/covidcast-signals/quidel.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,5 @@ not enough samples can be filled in from the parent state for smoothed signals s
159159
no data is reported for that area on that day; an API query for all reported geographic areas on
160160
that day will not include it.
161161

162-
## Flu Tests (inactive)
163-
These signals were updated until May 19, 2020. Documentation is still available on the [inactive Quidel page](quidel-inactive.md).
162+
## Flu Tests
163+
These signals are inactive. They were updated until May 19, 2020. Documentation is still available on the [Quidel influenza page](quidel-flu.md).
File renamed without changes.

docs/api/covidcast_licensing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Attribution license](https://creativecommons.org/licenses/by/4.0/):
3636

3737
* [Doctor Visits](covidcast-signals/doctor-visits.md)
3838
* [Hospital Admissions](covidcast-signals/hospital-admissions.md)
39-
* [Indicator Combination](covidcast-signals/indicator-combination-inactive.md): signals
39+
* [Indicator Combination](covidcast-signals/indicator-combination.md): signals
4040
with names beginning `nmf_*`
4141
* [Quidel](covidcast-signals/quidel.md)
4242
* [COVID-19 Trends and Impact Survey](covidcast-signals/fb-survey.md)
@@ -61,7 +61,7 @@ These data streams are essentially mirrors of their respective sources, and are
6161
published here subject to the original license provided by the source:
6262

6363
* [Google Health Trends](covidcast-signals/ght.md)
64-
* [Indicator Combination](covidcast-signals/indicator-combination-inactive.md): cases and
64+
* [Indicator Combination](covidcast-signals/indicator-combination.md): cases and
6565
deaths signals
6666
* [JHU Cases and Deaths](covidcast-signals/jhu-csse.md)
6767
* [SafeGraph Mobility](covidcast-signals/safegraph.md)

0 commit comments

Comments
 (0)