-
Notifications
You must be signed in to change notification settings - Fork 16
First pass of the CDC Vaccination Indicator #1238
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
Closed
Closed
Changes from 4 commits
Commits
Show all changes
136 commits
Select commit
Hold shift + click to select a range
89410dc
First pass of the CDC Indicator
Ananya-Joshi 4799139
added explicit dictionary creation
Ananya-Joshi 5d92ed4
added os import
Ananya-Joshi 7836d23
Minor changes for the linter - tests pass locally
Ananya-Joshi 52e04c2
Update cdc_vaccines/delphi_cdc_vaccines/__main__.py
Ananya-Joshi 16c1050
Update cdc_vaccines/delphi_cdc_vaccines/constants.py
Ananya-Joshi 350f91c
Update cdc_vaccines/README.md
Ananya-Joshi 9b102db
Update cdc_vaccines/README.md
Ananya-Joshi f08c9b1
Update cdc_vaccines/params.json.template
Ananya-Joshi 2a0dcae
Update cdc_vaccines/README.md
Ananya-Joshi e1187f3
Update cdc_vaccines/delphi_cdc_vaccines/run.py
Ananya-Joshi 04fbc1d
Update cdc_vaccines/delphi_cdc_vaccines/pull.py
Ananya-Joshi ba11d3c
minor changes
Ananya-Joshi 8f7b814
Merge branch 'indicator_cdc_vaccines' of https://github.com/cmu-delph…
Ananya-Joshi ff808a4
changes to the json file
Ananya-Joshi 675106c
changed the signal name generation
Ananya-Joshi 0804d12
committed constants
Ananya-Joshi 8963748
Update cdc_vaccines/README.md
Ananya-Joshi b2769e6
Modified run.py to have the right NaN codes
Ananya-Joshi b5f82b7
Merge branch 'indicator_cdc_vaccines' of https://github.com/cmu-delph…
Ananya-Joshi d0349a6
Added appropriate NaN codes
Ananya-Joshi e9b4a6a
Update cdc_vaccines/delphi_cdc_vaccines/run.py
Ananya-Joshi 652664a
added back appropriate nan codes
Ananya-Joshi 3401d71
changes to run.py
Ananya-Joshi 58ee0e2
Update utilities for NAN codes:
dshemetov e035a21
Nans: update archiver deletion handling
dshemetov 292084b
Nans: update archiver deletion
dshemetov 8c9f41f
Nancodes archiver: rename variable for clarity
dshemetov 738b201
Nancodes archiver: small formatting change
dshemetov f67925b
Nancodes: make linter happy
dshemetov 661fab9
create dockerfile and dockerignore to host survey pipeline
nmdefries 3043cb4
force Rcpp update and install utils via pip
nmdefries 46e2d47
install wheel dependency
nmdefries 1365da1
move docker files to facebook dir
nmdefries 55ed232
add more package requirements
nmdefries 583c5e1
remove dockerignore
nmdefries 11186b9
specify readr version
nmdefries 21b908d
- Adds BH dependency
korlaxxalrok 6e783c4
Add ssmtp config
korlaxxalrok 2f33968
Change geo_sig call
qx-teo 0627683
Changing to using requests module
qx-teo a8ef938
Fix imports
qx-teo 7e8dff6
Fix geo_combos
qx-teo a0366c4
Include indicator name
qx-teo 8fbf23b
Improve clarity
qx-teo 80c67d8
Fix syntax
qx-teo db508d2
Update README
qx-teo d8c0ec5
Update PLANS.md
qx-teo 4d9d214
remove more addressed issues
nmdefries a1b443b
Update _delphi_utils_python/delphi_utils/validator/README.md
qx-teo 04bf3f9
Update README.md
qx-teo b3c9325
Update PLANS.md
qx-teo ec51e1a
remove us territories from valid zips list
nmdefries c10adcc
fix tests
nmdefries c450e3b
stop supporting non-default aggs; revert #977
nmdefries 85dd31f
simplify aggregate range selection; drop support for 'both'
nmdefries 643bef9
remove mc_ agg processing
nmdefries 1b1bc5e
add default contingency Rprof command
nmdefries 8e0ebde
remove missing weights up front
nmdefries 3b69c28
make clear that add_geo_vars acts on cols
nmdefries a41b6b4
create Cpp is_selected; R vers only on uniques
nmdefries ce4634b
deduplicate preparing group agg output
nmdefries 2ad7b4c
switch na filter to use data.table with
nmdefries 868aa20
update documentation
nmdefries ed93b3c
apply contingency changes to API agg func
nmdefries 309a013
switch weights handling to use data.table
nmdefries 37f97bc
misc cleanup
nmdefries a663f19
set up C++ package structure so can use in parallel
nmdefries 0a4dc61
store output in list of lists
nmdefries f548c6a
comments
nmdefries 5567ba0
cpp style
nmdefries d882622
remove test code
nmdefries 0080d6e
rm cpp compile files
nmdefries 693a25e
prevent raceeth missing error
nmdefries 9dca6cb
[hhs_hosp] Permit generating backissues
krivard 7338a96
ignore msa vaccine barriers "tried"
nmdefries c2bcb47
set weight field names in fread
nmdefries d420a2e
chore: bump delphi_utils to 0.1.11
2657fdb
chore: bump covidcast-indicators to 0.1.14
fc09f49
clean up organization and docstring for get_geos_within method
alexcoda a358dcd
Make docstring arguments up-to-date.
alexcoda 198dd29
fix lint
alexcoda 180ed9a
Update _delphi_utils_python/delphi_utils/geomap.py
alexcoda 9ce0670
Update _delphi_utils_python/delphi_utils/geomap.py
alexcoda d4f8bf1
Include given values in get_geos_within error message
alexcoda 6573b08
Remove caching in geomap.py
alexcoda bf28950
Simplify _load_crosswalk_from_file method
alexcoda 2e4c4c4
Add missing imports to run.py template
alexcoda cb34ad0
chore: bump delphi_utils to 0.1.12
225e16d
chore: bump covidcast-indicators to 0.1.15
6cfe2bc
use recoded values, where available, for response choice codes
nmdefries 2e3ef74
recode values in display logic
nmdefries bfb81f5
Makefile changes
korlaxxalrok a762ca7
Adds new params to template
korlaxxalrok e132c7d
vars changes
korlaxxalrok fe3d9c3
Add new secrets to vault
korlaxxalrok 8f9d38f
chore: bump covidcast-indicators to 0.1.16
bc083b7
Build facebook container image
korlaxxalrok 01d142b
un-retire schooling indicators from sirCAL
nmdefries 372ecab
break line
nmdefries 0204d88
add closing bracket
nmdefries f361676
Nancodes archiver: remove deleted file nan replacements
dshemetov ea68224
Update archiver docstrings
dshemetov b873a95
Update archiver docstrings
dshemetov 49a5766
Nancodes archiver/export: explicit tests
dshemetov 874623e
Update setup.py files to "Python :: 3.8" annotation
dshemetov f350dd6
Correctly ignore all receiving/*.csv files
dshemetov d827480
check if readr is installed
nmdefries 3397277
only install remotes if not avail; upgrade as needed
nmdefries 4b8ee7a
test run with no cache
nmdefries b043d54
Revert "test run with no cache"
nmdefries e40cd55
Fix value check in quidel data_tools
alexcoda 6849004
Replace print statements with logging
alexcoda ff84e3a
lint
alexcoda 74a84e4
lint
alexcoda 6bfd724
Fix missing logger in tests
alexcoda 50fd522
Fix missing logger in tests
alexcoda d6d0534
Instantiate logger correctly in tests
alexcoda 52f8cb2
Fix error check
alexcoda 511bf2e
Update quidel/delphi_quidel/pull.py
alexcoda d572e26
Update quidel/delphi_quidel/pull.py
alexcoda 33e9325
Update quidel_covidtest/delphi_quidel_covidtest/pull.py
alexcoda 775d125
Update quidel_covidtest/delphi_quidel_covidtest/pull.py
alexcoda e6ade5a
Add new host to inventory
korlaxxalrok 2f1927a
Re-add primary back to inventory
korlaxxalrok 9a3f4f1
Remove bare except in DV
chinandrew 000dc8b
set E2 to integer on read
nmdefries 9b00342
Switch CDC Covidnet to use structed logger
chinandrew c7d7ce0
Switch to structed logger for ChangeHC
chinandrew 02f7080
switch doctor visits to structured logger
chinandrew c21b544
Refactor NCHS mortality to use delphi export util
chinandrew ca09586
Remove test for old export func
chinandrew 90ea653
resolved misssing name issue with another PR, retrying this one.
Ananya-Joshi b9c6e8a
Merge branch 'main' into indicator_cdc_vaccines
Ananya-Joshi d3544d0
Cdc vaccines: add basic nancodes
dshemetov ea6587d
Cdc vaccines: add docstring for linter
dshemetov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
[MESSAGES CONTROL] | ||
|
||
disable=logging-format-interpolation, | ||
too-many-locals, | ||
too-many-arguments, | ||
# Allow pytest functions to be part of a class. | ||
no-self-use, | ||
# Allow pytest classes to have one test. | ||
too-few-public-methods | ||
|
||
[BASIC] | ||
|
||
# Allow arbitrarily short-named variables. | ||
variable-rgx=[a-z_][a-z0-9_]* | ||
argument-rgx=[a-z_][a-z0-9_]* | ||
attr-rgx=[a-z_][a-z0-9_]* | ||
|
||
[DESIGN] | ||
|
||
# Don't complain about pytest "unused" arguments. | ||
ignored-argument-names=(_.*|run_as_module) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.PHONY = venv, lint, test, clean | ||
|
||
dir = $(shell find ./delphi_* -name __init__.py | grep -o 'delphi_[_[:alnum:]]*') | ||
|
||
venv: | ||
python3.8 -m venv env | ||
|
||
install: venv | ||
. env/bin/activate; \ | ||
pip install wheel ; \ | ||
pip install -e ../_delphi_utils_python ;\ | ||
pip install -e . | ||
|
||
lint: | ||
. env/bin/activate; pylint $(dir) | ||
. env/bin/activate; pydocstyle $(dir) | ||
|
||
test: | ||
. env/bin/activate ;\ | ||
(cd tests && ../env/bin/pytest --cov=$(dir) --cov-report=term-missing) | ||
|
||
clean: | ||
rm -rf env | ||
rm -f params.json | ||
|
||
run: | ||
env/bin/python -m $(dir) | ||
env/bin/python -m delphi_utils.validator --dry_run | ||
env/bin/python -m delphi_utils.archive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# CDC Vaccinations | ||
|
||
This indicator provides the number official vaccinations in the US. We export the county-level | ||
daily vaccination rates data as-is, and publishes the result as a COVIDcast signal. | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
We also aggregate the data to the HHS, State, and Nation levels. | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
For detailed information see the files DETAILS.md contained in this directory. | ||
|
||
Note that individuals could be vaccinated outside of the US. Additionally, | ||
there is no county level data for counties in Texas and Hawaii. There are unknown | ||
counties in each state and a row for unknown county and unknown state. | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
## Running the Indicator | ||
|
||
The indicator is run by directly executing the Python module contained in this | ||
directory. The safest way to do this is to create a virtual environment, | ||
installed the common DELPHI tools, and then install the module and its | ||
dependencies. To do this, run the following command from this directory: | ||
|
||
``` | ||
make install | ||
``` | ||
|
||
This command will install the package in editable mode, so you can make changes that | ||
will automatically propagate to the installed package. | ||
|
||
All of the user-changable parameters are stored in `params.json`. To execute | ||
the module and produce the output datasets (by default, in `receiving`), run | ||
the following: | ||
|
||
``` | ||
env/bin/python -m delphi_cdc_vaccines | ||
``` | ||
|
||
If you want to enter the virtual environment in your shell, | ||
you can run `source env/bin/activate`. Run `deactivate` to leave the virtual environment. | ||
|
||
Once you are finished, you can remove the virtual environment and | ||
params file with the following: | ||
|
||
``` | ||
make clean | ||
``` | ||
|
||
## Testing the code | ||
|
||
To run static tests of the code style, run the following command: | ||
|
||
``` | ||
make lint | ||
``` | ||
|
||
Unit tests are also included in the module. To execute these, run the following | ||
command from this directory: | ||
|
||
``` | ||
make test | ||
``` | ||
|
||
To run individual tests, run the following: | ||
|
||
``` | ||
(cd tests && ../env/bin/pytest test_run.py --cov=delphi_ --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 linting or unit tests should fail, and the code lines that are not covered by unit tests should be small and | ||
should not include critical sub-routines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Code Review (Python) | ||
|
||
A code review of this module should include a careful look at the code and the | ||
output. To assist in the process, but certainly not in replace of it, please | ||
check the following items. | ||
|
||
**Documentation** | ||
|
||
- [ ] 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 | ||
included for all functions; full docstrings describing the inputs and expected | ||
outputs should be given for non-trivial functions | ||
|
||
**Structure** | ||
|
||
- [ ] code should pass lint checks (`make lint`) | ||
- [ ] 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 | ||
be placed in the directory `cache` | ||
- [ ] 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 | ||
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 (`make install`) | ||
- [ ] 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 (`make test`) | ||
- [ ] indicator directory has been added to GitHub CI | ||
(`covidcast-indicators/.github/workflows/python-ci.yml`) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Module to pull and clean indicators from the CDC source. | ||
|
||
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 pull | ||
from . import run | ||
|
||
__version__ = "0.1.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Call the function run_module when executed. | ||
|
||
This file indicates that calling the module (`python -m MODULE_NAME`) will | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
call the function `run_module` found within the run.py file. There should be | ||
no need to change this template. | ||
""" | ||
|
||
from delphi_utils import read_params | ||
from .run import run_module # pragma: no cover | ||
|
||
run_module(read_params()) # pragma: no cover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"""Registry for variations.""" | ||
|
||
|
||
from delphi_utils import Smoother | ||
|
||
FULL_VAC_SUM = "cumulative_counts_tot_vaccine" | ||
FULL_VAC = "counts_tot_vaccine" | ||
FULL_VAC_SUM_12P = "cumulative_counts_tot_vaccine_12P" | ||
FULL_VAC_12P = "counts_tot_vaccine_12P" | ||
FULL_VAC_SUM_18P = "cumulative_counts_tot_vaccine_18P" | ||
FULL_VAC_18P = "counts_tot_vaccine_18P" | ||
FULL_VAC_SUM_65P = "cumulative_counts_tot_vaccine_65P" | ||
FULL_VAC_65P = "counts_tot_vaccine_65P" | ||
PART_VAC_SUM = "cumulative_counts_part_vaccine" | ||
PART_VAC = "counts_part_vaccine" | ||
PART_VAC_SUM_12P = "cumulative_counts_part_vaccine_12P" | ||
PART_VAC_12P = "counts_part_vaccine_12P" | ||
PART_VAC_SUM_18P = "cumulative_counts_part_vaccine_18P" | ||
PART_VAC_18P = "counts_part_vaccine_18P" | ||
PART_VAC_SUM_65P = "cumulative_counts_part_vaccine_65P" | ||
PART_VAC_65P = "counts_part_vaccine_65P" | ||
|
||
|
||
|
||
SIGNALS = [ | ||
FULL_VAC_SUM , | ||
FULL_VAC , | ||
FULL_VAC_SUM_12P , | ||
FULL_VAC_12P , | ||
FULL_VAC_SUM_18P , | ||
FULL_VAC_18P , | ||
FULL_VAC_SUM_65P , | ||
FULL_VAC_65P , | ||
PART_VAC_SUM , | ||
PART_VAC , | ||
PART_VAC_SUM_12P , | ||
PART_VAC_12P , | ||
PART_VAC_SUM_18P , | ||
PART_VAC_18P , | ||
PART_VAC_SUM_65P , | ||
PART_VAC_65P | ||
] | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
GEOS = [ | ||
"nation", | ||
"state_code", | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"hrr", | ||
"hhs" | ||
] | ||
Ananya-Joshi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
SMOOTHERS = [ | ||
(Smoother("identity", impute_method=None), ""), | ||
(Smoother("moving_average", window_length=7), "_7dav"), | ||
] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.