Skip to content

Commit 378f821

Browse files
authored
Merge pull request #1779 from cmu-delphi/release/indicators_v0.3.30_utils_v0.3.9
Release covidcast-indicators 0.3.30
2 parents 2748d2b + d7bc78d commit 378f821

File tree

191 files changed

+190009
-75823
lines changed

Some content is hidden

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

191 files changed

+190009
-75823
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.3.29
2+
current_version = 0.3.30
33
commit = True
44
message = chore: bump covidcast-indicators to {new_version}
55
tag = False

.github/workflows/build-container-images.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}
2323

2424
- name: Build, tag, and push image to Github
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2527
run: |
2628
baseRef="${GITHUB_REF#*/}"
2729
baseRef="${baseRef#*/}"

.github/workflows/python-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.event.pull_request.draft == false
1717
strategy:
1818
matrix:
19-
packages: [_delphi_utils_python, changehc, claims_hosp, doctor_visits, dsew_community_profile, google_symptoms, hhs_hosp, hhs_facilities, jhu, nchs_mortality, nowcast, quidel, quidel_covidtest, safegraph_patterns, sir_complainsalot]
19+
packages: [_delphi_utils_python, changehc, claims_hosp, doctor_visits, dsew_community_profile, google_symptoms, hhs_hosp, hhs_facilities, jhu, nchs_mortality, nowcast, quidel_covidtest, safegraph_patterns, sir_complainsalot]
2020
defaults:
2121
run:
2222
working-directory: ${{ matrix.packages }}

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- TODO: #527 Get this list automatically from python-ci.yml at runtime.
1111
*/
1212

13-
def indicator_list = ["backfill_corrections", "changehc", "claims_hosp", "google_symptoms", "hhs_hosp", "jhu", "nchs_mortality", "quidel", "quidel_covidtest", "safegraph_patterns", "sir_complainsalot", "dsew_community_profile", "doctor_visits"]
13+
def indicator_list = ["backfill_corrections", "changehc", "claims_hosp", "google_symptoms", "hhs_hosp", "jhu", "nchs_mortality", "quidel_covidtest", "safegraph_patterns", "sir_complainsalot", "dsew_community_profile", "doctor_visits"]
1414
def build_package_main = [:]
1515
def build_package_prod = [:]
1616
def deploy_staging = [:]

_delphi_utils_python/.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.3.8
2+
current_version = 0.3.9
33
commit = True
44
message = chore: bump delphi_utils to {new_version}
55
tag = False

_delphi_utils_python/delphi_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
from .nancodes import Nans
1616
from .weekday import Weekday
1717

18-
__version__ = "0.3.8"
18+
__version__ = "0.3.9"
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# FlaSH System
2+
3+
THIS README IS IN PROGRESS
4+
5+
FlaSH is a real-time point-outlier detection system. We add the daily evaluation step to this indicators package (retraining is done offline).
6+
7+
FlaSH produces a list of data points that are unusual or surprising so that stakeholders are aware of points that warrant further inspection.
8+
9+
The guiding principles for the system are:
10+
- Flag relevant data points as soon as possible (ideally in an online setting)
11+
- Be aware of the false positive/false negative rates
12+
- Reduce cognitive load on data evaluators
13+
14+
Types of outliers/changes FlaSH intends to catch are:
15+
- Out-of-range points
16+
- Large spikes
17+
- Points that are interesting for a particular weekday
18+
- Points that are interesting with respect to a particular stream's history
19+
- Points that are interesting with respect to all other streams
20+
- Change in data reporting schedule
21+
- Changes in health condition [ex: new variant]
22+
23+
## Running FlaSH-eval
24+
25+
First, run the indicator so that there are files for FlaSH to check.
26+
27+
You can excecute the Python module contained in this
28+
directory from the main directory of the indicator of interest.
29+
30+
The safest way to do this is to create a virtual environment,
31+
and install the common DELPHI tools, including flash, and the
32+
flash module and its dependencies to the virtual environment.
33+
34+
To do this, navigate to the main directory of the indicator of interest and run the following code:
35+
36+
```
37+
python -m venv env
38+
source env/bin/activate
39+
pip install ../_delphi_utils_python/.
40+
pip install .
41+
```
42+
43+
To execute the module run the indicator to generate data files and then run
44+
the flash system , as follows:
45+
46+
```
47+
env/bin/python -m delphi_INDICATORNAME
48+
env/bin/python -m delphi_utils.flash_eval
49+
50+
```
51+
52+
Once you are finished with the code, you can deactivate the virtual environment
53+
and (optionally) remove the environment itself.
54+
55+
```
56+
deactivate
57+
rm -r env
58+
```
59+
60+
### Customization
61+
62+
All of the user-changable parameters are stored in the `flash` field of the indicator's `params.json` file. If `params.json` does not already include a `flash` field, please copy that provided in this module's `params.json.template`.
63+
64+
Please update the follow settings:
65+
- signals: a list of which signals for that indicator go through FlaSH.
66+
67+
## Testing the code
68+
69+
To test the code, please create a new virtual environment in the main module directory using the following procedure, similar to above:
70+
71+
```
72+
make install
73+
```
74+
75+
To do a static test of the code style, it is recommended to run **pylint** on
76+
the module. To do this, run the following from the main module directory:
77+
78+
```
79+
make lint
80+
```
81+
82+
The most aggressive checks are turned off; only relatively important issues
83+
should be raised and they should be manually checked (or better, fixed).
84+
85+
Unit tests are also included in the module. To execute these, run the following command from this directory:
86+
87+
```
88+
make test
89+
```
90+
91+
or
92+
93+
```
94+
(cd tests && ../env/bin/pytest test_file.py --cov=delphi_utils --cov-report=term-missing)
95+
```
96+
97+
The output will show the number of unit tests that passed and failed, along with the percentage of code covered by the tests. None of the tests should fail and the code lines that are not covered by unit tests should be small and should not include critical sub-routines.
98+
99+
100+
## Adding checks
101+
102+
To add a new validation check. Each check should append a descriptive error message to the `raised` attribute if triggered. All checks should allow the user to override exception raising for a specific file using the `suppressed_errors` setting in `params.json`.

quidel/REVIEW.md renamed to _delphi_utils_python/delphi_utils/flash_eval/REVIEW.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,34 @@ check the following items.
66

77
**Documentation**
88

9-
- [ ] the README.md file template is filled out and currently accurate; it is
9+
- [] the README.md file template is filled out and currently accurate; it is
1010
possible to load and test the code using only the instructions given
11-
- [ ] minimal docstrings (one line describing what the function does) are
11+
- [] minimal docstrings (one line describing what the function does) are
1212
included for all functions; full docstrings describing the inputs and expected
1313
outputs should be given for non-trivial functions
1414

1515
**Structure**
1616

17-
- [ ] code should use 4 spaces for indentation; other style decisions are
17+
- [] code should use 4 spaces for indentation; other style decisions are
1818
flexible, but be consistent within a module
19-
- [ ] any required metadata files are checked into the repository and placed
19+
- [] any required metadata files are checked into the repository and placed
2020
within the directory `static`
21-
- [ ] any intermediate files that are created and stored by the module should
21+
- [] any intermediate files that are created and stored by the module should
2222
be placed in the directory `cache`
23-
- [ ] final expected output files to be uploaded to the API are placed in the
23+
- [] final expected output files to be uploaded to the API are placed in the
2424
`receiving` directory; output files should not be committed to the respository
25-
- [ ] all options and API keys are passed through the file `params.json`
26-
- [ ] template parameter file (`params.json.template`) is checked into the
25+
- [] all options and API keys are passed through the file `params.json`
26+
- [] template parameter file (`params.json.template`) is checked into the
2727
code; no personal (i.e., usernames) or private (i.e., API keys) information is
2828
included in this template file
2929

3030
**Testing**
3131

32-
- [ ] module can be installed in a new virtual environment
33-
- [ ] pylint with the default `.pylint` settings run over the module produces
32+
- [] module can be installed in a new virtual environment
33+
- [] pylint with the default `.pylint` settings run over the module produces
3434
minimal warnings; warnings that do exist have been confirmed as false positives
35-
- [ ] reasonably high level of unit test coverage covering all of the main logic
35+
- [] reasonably high level of unit test coverage covering all of the main logic
3636
of the code (e.g., missing coverage for raised errors that do not currently seem
3737
possible to reach are okay; missing coverage for options that will be needed are
3838
not)
39-
- [ ] all unit tests run without errors
39+
- [] all unit tests run without errors
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
# -*- coding: utf-8 -*-
2-
"""Module to pull and clean indicators from the Quidel COVID Test.
2+
"""Module to flagging interesting or unusual data points.
33
44
This file defines the functions that are made public by the module. As the
55
module is intended to be executed though the main method, these are primarily
66
for testing.
77
"""
8-
98
from __future__ import absolute_import
10-
11-
from . import geo_maps
12-
from . import data_tools
13-
from . import generate_sensor
14-
from . import pull
15-
from . import run
9+
from .constants import HTML_LINK

quidel/delphi_quidel/__main__.py renamed to _delphi_utils_python/delphi_utils/flash_eval/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""Call the function run_module when executed.
32
43
This file indicates that calling the module (`python -m MODULE_NAME`) will
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""Constants used in FlaSH."""
2+
3+
#Regions considered under states
4+
STATES = ['ak', 'al', 'ar', 'as', 'az', 'ca', 'co', 'ct', 'dc', 'de', 'fl', 'ga',
5+
'gu', 'hi', 'ia', 'id', 'il', 'in', 'ks', 'ky', 'la',
6+
'ma', 'md', 'me', 'mi', 'mn', 'mo', 'mp', 'ms', 'mt', 'nc',
7+
'nd', 'ne', 'nh', 'nj', 'nm', 'nv', 'ny', 'oh', 'ok',
8+
'or', 'pa', 'pr', 'ri', 'sc', 'sd', 'tn', 'tx', 'ut', 'va', 'vi', 'vt',
9+
'wa', 'wi', 'wv', 'wy']
10+
11+
#HTML Link for the visualization tool alerts
12+
HTML_LINK = "<https://ananya-joshi-visapp-vis-523f3g.streamlitapp.com/?params="

0 commit comments

Comments
 (0)