Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release covidcast-indicators 0.3.30 #1779

Merged
merged 32 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
350cf64
local commit, save
Ananya-Joshi Dec 6, 2022
17236a7
functional code
Ananya-Joshi Dec 7, 2022
897fb43
checkpoint commit
Ananya-Joshi Dec 8, 2022
ecdbe58
originial flash
Jan 5, 2023
d9ecd8f
basic testing and linting complete
Jan 6, 2023
2697edc
added in tests
Jan 6, 2023
d555acd
drop lambda wrapper in pd.apply
nmdefries Jan 18, 2023
f82b6a4
v3 FlaSH: simplified I/O structure & clearer outlier buckets
Jan 22, 2023
e340c1d
double quotes in the params files
Jan 22, 2023
c6072ec
fixed test so no overwrites, added aws code
Jan 24, 2023
b80e71c
minor changes resulting from string list elements in json files
Jan 24, 2023
f78bbfa
Squash Commits from PR testing
Jan 24, 2023
c02bbcc
don't evaluate days that are 0 if they're not updated daily
Jan 30, 2023
5d18239
additional features for saved FlaSH file
Jan 30, 2023
2e23698
typo
Jan 30, 2023
f3b022a
lint fix
Jan 30, 2023
e5ffa45
Merge pull request #1771 from cmu-delphi/bot/sync-prod-main
krivard Jan 30, 2023
f5d15e8
changed out-of-range handling and params for run when flash not part …
Jan 30, 2023
9cbc276
check if any files exist in receiving before trying to publish
nmdefries Jan 31, 2023
30fc432
Merge pull request #1772 from cmu-delphi/ndefries/backfill/check-publ…
krivard Feb 1, 2023
5b05688
Deactivate Quidel flu
minhkhul Feb 2, 2023
f172949
Avoid dynamic validation when no files are exported (#1773)
M5Skid Feb 3, 2023
ac10f61
Merge pull request #1774 from cmu-delphi/deactivate-quidel
krivard Feb 3, 2023
4fed7bc
publish from export dir
nmdefries Feb 3, 2023
b5c9c93
channged additive factor
Feb 6, 2023
301fe2f
Merge pull request #1751 from cmu-delphi/flash_eval
krivard Feb 6, 2023
99987c4
Merge pull request #1776 from cmu-delphi/ndefries/backfill/output-dir…
krivard Feb 6, 2023
c546ef1
use api token
nmdefries Feb 6, 2023
adee70d
Merge pull request #1778 from cmu-delphi/ndefries/authenticate-build-ci
krivard Feb 6, 2023
4c591f5
chore: bump delphi_utils to 0.3.9
Feb 6, 2023
c519eb6
chore: bump covidcast-indicators to 0.3.30
Feb 6, 2023
d7bc78d
[create-pull-request] automated change
krivard Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.29
current_version = 0.3.30
commit = True
message = chore: bump covidcast-indicators to {new_version}
tag = False
2 changes: 2 additions & 0 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
password: ${{ secrets.CMU_DELPHI_DEPLOY_MACHINE_PAT }}

- name: Build, tag, and push image to Github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
baseRef="${GITHUB_REF#*/}"
baseRef="${baseRef#*/}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event.pull_request.draft == false
strategy:
matrix:
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]
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]
defaults:
run:
working-directory: ${{ matrix.packages }}
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- TODO: #527 Get this list automatically from python-ci.yml at runtime.
*/

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"]
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"]
def build_package_main = [:]
def build_package_prod = [:]
def deploy_staging = [:]
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.3.8
current_version = 0.3.9
commit = True
message = chore: bump delphi_utils to {new_version}
tag = False
Expand Down
2 changes: 1 addition & 1 deletion _delphi_utils_python/delphi_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
from .nancodes import Nans
from .weekday import Weekday

__version__ = "0.3.8"
__version__ = "0.3.9"
102 changes: 102 additions & 0 deletions _delphi_utils_python/delphi_utils/flash_eval/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# FlaSH System

THIS README IS IN PROGRESS

FlaSH is a real-time point-outlier detection system. We add the daily evaluation step to this indicators package (retraining is done offline).

FlaSH produces a list of data points that are unusual or surprising so that stakeholders are aware of points that warrant further inspection.

The guiding principles for the system are:
- Flag relevant data points as soon as possible (ideally in an online setting)
- Be aware of the false positive/false negative rates
- Reduce cognitive load on data evaluators

Types of outliers/changes FlaSH intends to catch are:
- Out-of-range points
- Large spikes
- Points that are interesting for a particular weekday
- Points that are interesting with respect to a particular stream's history
- Points that are interesting with respect to all other streams
- Change in data reporting schedule
- Changes in health condition [ex: new variant]

## Running FlaSH-eval

First, run the indicator so that there are files for FlaSH to check.

You can excecute the Python module contained in this
directory from the main directory of the indicator of interest.

The safest way to do this is to create a virtual environment,
and install the common DELPHI tools, including flash, and the
flash module and its dependencies to the virtual environment.

To do this, navigate to the main directory of the indicator of interest and run the following code:

```
python -m venv env
source env/bin/activate
pip install ../_delphi_utils_python/.
pip install .
```

To execute the module run the indicator to generate data files and then run
the flash system , as follows:

```
env/bin/python -m delphi_INDICATORNAME
env/bin/python -m delphi_utils.flash_eval

```

Once you are finished with the code, you can deactivate the virtual environment
and (optionally) remove the environment itself.

```
deactivate
rm -r env
```

### Customization

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`.

Please update the follow settings:
- signals: a list of which signals for that indicator go through FlaSH.

## Testing the code

To test the code, please create a new virtual environment in the main module directory using the following procedure, similar to above:

```
make install
```

To do a static test of the code style, it is recommended to run **pylint** on
the module. To do this, run the following from the main module directory:

```
make lint
```

The most aggressive checks are turned off; only relatively important issues
should be raised and they should be manually checked (or better, fixed).

Unit tests are also included in the module. To execute these, run the following command from this directory:

```
make test
```

or

```
(cd tests && ../env/bin/pytest test_file.py --cov=delphi_utils --cov-report=term-missing)
```

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.


## Adding checks

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`.
24 changes: 12 additions & 12 deletions quidel/REVIEW.md → ..._python/delphi_utils/flash_eval/REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ check the following items.

**Documentation**

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

**Structure**

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

**Testing**

- [ ] module can be installed in a new virtual environment
- [ ] pylint with the default `.pylint` settings run over the module produces
- [] module can be installed in a new virtual environment
- [] pylint with the default `.pylint` settings run over the module produces
minimal warnings; warnings that do exist have been confirmed as false positives
- [ ] reasonably high level of unit test coverage covering all of the main logic
- [] reasonably high level of unit test coverage covering all of the main logic
of the code (e.g., missing coverage for raised errors that do not currently seem
possible to reach are okay; missing coverage for options that will be needed are
not)
- [ ] all unit tests run without errors
- [] all unit tests run without errors
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# -*- coding: utf-8 -*-
"""Module to pull and clean indicators from the Quidel COVID Test.
"""Module to flagging interesting or unusual data points.

This file defines the functions that are made public by the module. As the
module is intended to be executed though the main method, these are primarily
for testing.
"""

from __future__ import absolute_import

from . import geo_maps
from . import data_tools
from . import generate_sensor
from . import pull
from . import run
from .constants import HTML_LINK
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Call the function run_module when executed.

This file indicates that calling the module (`python -m MODULE_NAME`) will
Expand Down
12 changes: 12 additions & 0 deletions _delphi_utils_python/delphi_utils/flash_eval/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Constants used in FlaSH."""

#Regions considered under states
STATES = ['ak', 'al', 'ar', 'as', 'az', 'ca', 'co', 'ct', 'dc', 'de', 'fl', 'ga',
'gu', 'hi', 'ia', 'id', 'il', 'in', 'ks', 'ky', 'la',
'ma', 'md', 'me', 'mi', 'mn', 'mo', 'mp', 'ms', 'mt', 'nc',
'nd', 'ne', 'nh', 'nj', 'nm', 'nv', 'ny', 'oh', 'ok',
'or', 'pa', 'pr', 'ri', 'sc', 'sd', 'tn', 'tx', 'ut', 'va', 'vi', 'vt',
'wa', 'wi', 'wv', 'wy']

#HTML Link for the visualization tool alerts
HTML_LINK = "<https://ananya-joshi-visapp-vis-523f3g.streamlitapp.com/?params="
Loading