Skip to content

Refactor doctor visits to use smoothing package #436

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

Open
wants to merge 1,018 commits into
base: dv-package
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1018 commits
Select commit Hold shift + click to select a range
ade3feb
Added missing test directory
eujing Oct 7, 2020
b830cc8
Remove trailing whitespace
krivard Oct 7, 2020
8867c14
Merge pull request #217 from cmu-delphi/rf_geo_refactor
krivard Oct 7, 2020
bcda25f
Reduce df memory usage, and vectorize more
eujing Oct 7, 2020
650c12e
Merge pull request #297 from cmu-delphi/main
krivard Oct 7, 2020
4a58a16
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 8, 2020
547fab8
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 8, 2020
12aa17d
Fix JHU's fips-population source file
dshemetov Oct 8, 2020
8d77066
Fix docs typo in _delphi_utils_python/delphi_utils/archive.py
krivard Oct 9, 2020
8678fba
Merge pull request #295 from sgsmob/main
krivard Oct 9, 2020
c687428
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 9, 2020
309fb79
Fix JHU bug that renamed fips to county in receiving
dshemetov Oct 9, 2020
93b5ba2
Merge pull request #304 from cmu-delphi/jhu_fips_county_fix
krivard Oct 9, 2020
d357d01
Merge pull request #305 from cmu-delphi/deploy-jhu
krivard Oct 9, 2020
81be4f4
update code for geomapping using utils
Oct 12, 2020
eec5f50
fix typo in documentation
huisaddison Oct 12, 2020
0c502f7
fix typo in documentation
huisaddison Oct 12, 2020
37edbf5
fix typo in documentation
huisaddison Oct 12, 2020
3a0f9a9
fix typo in documentation
huisaddison Oct 12, 2020
a2d5768
fix typo in documentation
huisaddison Oct 12, 2020
ed4c306
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 12, 2020
6a616c4
refactor safegraph.process to pave the way for multifile processing
sgsmob Oct 12, 2020
45307ad
tests for finding the file names in the past week
sgsmob Oct 12, 2020
d78ee3a
added unit tests for bad test files
Oct 13, 2020
c164a6d
fixed linter errors
Oct 13, 2020
b7ec16d
added description for data versioning
Oct 13, 2020
efdf3fd
testing process_window
sgsmob Oct 13, 2020
7ed90e1
comments and formatting for pylint compliance
sgsmob Oct 13, 2020
d0151e8
docstring updates
sgsmob Oct 13, 2020
8918ada
lint compliance in test cases
sgsmob Oct 13, 2020
6b24185
move location of VALID_GEO_RESOLUTIONS
sgsmob Oct 13, 2020
3a2adcb
added test data for bad cases
Oct 13, 2020
19ecdbc
Clarified data versioning documentation
eujing Oct 13, 2020
cf6f4c1
Merge pull request #287 from cmu-delphi/sir-dryrun
krivard Oct 13, 2020
10d3711
file existence checking in process
sgsmob Oct 13, 2020
8604ec1
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 13, 2020
c8605ad
Revert notebook to template
dshemetov Oct 13, 2020
4dddf0f
updated code for adding a test case where some necessary cols are mis…
Oct 13, 2020
e25d4c4
Merge branch 'nchs_mortality' of https://github.com/cmu-delphi/covidc…
Oct 13, 2020
4999ced
added data for the new test case
Oct 13, 2020
7ebc144
Merge pull request #301 from cmu-delphi/jhu_nyc_population_fix
krivard Oct 13, 2020
8c665c6
refactor CSV name
sgsmob Oct 13, 2020
7ff30ac
Extend geocode utility to actually support the mappings:
dshemetov Oct 13, 2020
e0ed614
add test for process
sgsmob Oct 14, 2020
8db87c5
fix line too long
sgsmob Oct 14, 2020
3d8c331
Add column renaming line in state conversion
dshemetov Oct 14, 2020
3b6d139
Geocode updates:
dshemetov Oct 14, 2020
8a1112d
Refactor to Geomapper function
chinandrew Oct 14, 2020
ddb331d
Refactor to use GeoMapper for fips to state
chinandrew Oct 15, 2020
0e1bd78
Change join behavior to match original
chinandrew Oct 15, 2020
d6f43ae
Change na behavior to be consistent with previous implementation
chinandrew Oct 15, 2020
ca7ccd0
Remove newline
chinandrew Oct 15, 2020
3912f4c
Add the smoothing utility class
dshemetov Oct 15, 2020
d8c491a
Remove unused variable
chinandrew Oct 15, 2020
e6502e5
remove extraneous prints
sgsmob Oct 15, 2020
922432b
documentation on process_file wrapper
sgsmob Oct 15, 2020
4debc31
fix broken usafacts tests to read from the proper directories
sgsmob Oct 15, 2020
53f2e6a
Merge branch 'fix_usa_tests' of github.com:sgsmob/covidcast-indicator…
sgsmob Oct 15, 2020
e93d5b6
migrate usafacts geo methods onto GeoMapper. Also fixes pylint compl…
sgsmob Oct 15, 2020
352abe6
Initial CHC commit
rumackaaron Oct 15, 2020
4563d1f
Merge branch 'main' into safegraph_patterns
Oct 16, 2020
1633036
uncomment code for using geo utils
Oct 16, 2020
6358975
fixed errors in geo mapping functions
Oct 16, 2020
0909ca7
fixed errors in geo mapping function and updated the unit tests
Oct 16, 2020
c4808fa
Merge branch 'safegraph_patterns' of https://github.com/cmu-delphi/co…
Oct 16, 2020
f6af0da
Add deprecation warning to left_gauss_linear and add more documentation
dshemetov Oct 16, 2020
424ceb4
deleted extra keyword argument in process
Oct 16, 2020
893aafc
Update comment on column assignment
chinandrew Oct 16, 2020
cada509
Update usafacts/delphi_usafacts/geo.py
sgsmob Oct 16, 2020
b55baf9
Merge branch 'weekday' of github.com:sgsmob/covidcast-indicators into…
sgsmob Oct 16, 2020
3495bee
added a dry-run mode
Oct 16, 2020
8ce66a2
convert geo.py to have all double quotes
sgsmob Oct 16, 2020
7b7934b
updated unit tests
Oct 16, 2020
986e585
fixed the dir to sample data
Oct 16, 2020
b0ae5bb
added static folder and params.json for unit tests
Oct 16, 2020
9925348
Small test docstring change
dshemetov Oct 16, 2020
06e4b12
replace deprecated functions
chinandrew Oct 16, 2020
f6e7b78
Remove uppercase
chinandrew Oct 16, 2020
a164e25
Remove print
chinandrew Oct 16, 2020
021cbb4
Remove zips static file
chinandrew Oct 16, 2020
707535e
Fix argument
chinandrew Oct 17, 2020
4ce4630
fix whitespacing for linter
huisaddison Oct 17, 2020
3d76de4
remove unused imports
huisaddison Oct 17, 2020
8091221
Add a gap detector to Sir Complainsalot
capnrefsmmat Oct 17, 2020
849263c
Formatting fix
capnrefsmmat Oct 17, 2020
39df546
Add hospital admissions, USAFacts to Sir Complainsalot
capnrefsmmat Oct 17, 2020
8fffe96
Fix JHU prop signal by zeroing out the state FIPS population in the p…
dshemetov Oct 18, 2020
296d75d
Improve indicator validation notebook template
dshemetov Oct 19, 2020
51c0c03
make new receiving directory in test directory
sgsmob Oct 19, 2020
e7b0b28
Removed redundant geo_maps file
rumackaaron Oct 19, 2020
6798c34
Added tests
rumackaaron Oct 19, 2020
0befb53
Merge pull request #311 from cmu-delphi/geo_refactor_cdccovidnet
krivard Oct 19, 2020
261503a
Merge pull request #225 from cmu-delphi/safegraph_patterns
krivard Oct 19, 2020
7c8e702
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 19, 2020
e1f96f9
Fix date_col docstring, add None option to date_col, add test for tha…
dshemetov Oct 19, 2020
cbfd2ac
Code cleanup and comments
rumackaaron Oct 19, 2020
90a22c4
don't overwrite files
sgsmob Oct 19, 2020
5117b9d
remove unused import
sgsmob Oct 19, 2020
509f4d7
substring testing with 'in'
sgsmob Oct 19, 2020
9d6394a
update tests to process to include wip and 7d_avg signals
sgsmob Oct 19, 2020
470e95d
added wip signals to params file
sgsmob Oct 19, 2020
0783ebd
Merge pull request #327 from cmu-delphi/sir-gapdetector
krivard Oct 19, 2020
5859982
Remove duplicated test
dshemetov Oct 19, 2020
84049be
Remove cruise ships FIPS codes, 88888 and 99999
dshemetov Oct 20, 2020
ee49484
Merge pull request #309 from sgsmob/weekday
krivard Oct 20, 2020
bb8e17e
Merge pull request #331 from cmu-delphi/deploy-safegraph
krivard Oct 20, 2020
d6cf8c6
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 20, 2020
fe9a64f
load crosswalk data instead of fips population csv
sgsmob Oct 20, 2020
0115538
Issue template for feature release
krivard Oct 20, 2020
44be069
Change auto-assign of release tasks
krivard Oct 20, 2020
3a208b0
Remove uszips.csv and params.json
rumackaaron Oct 20, 2020
a1a1b50
Temporarily skip linting in Jenkins
korlaxxalrok Oct 20, 2020
b0bb289
Merge pull request #314 from sgsmob/fix_usa_tests
krivard Oct 20, 2020
317a4d5
Merge pull request #334 from cmu-delphi/deploy-usafacts
krivard Oct 20, 2020
8ad5128
Enforce and test filenaming
rumackaaron Oct 20, 2020
e57673a
Revert "Add 7-day average of each signal to Safegraph indicator"
krivard Oct 20, 2020
283e8c2
Merge pull request #336 from cmu-delphi/revert-309-weekday
krivard Oct 20, 2020
b21252f
Merge pull request #322 from cmu-delphi/geo_refactor_claimshosp
krivard Oct 20, 2020
fd7254e
migrate off of custom fips population file
sgsmob Oct 20, 2020
3145ba1
remove references to old csv file
sgsmob Oct 20, 2020
01439d8
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 20, 2020
a2fc87b
Code review suggestions
rumackaaron Oct 20, 2020
9e46bc2
Make combo cases/deaths robust to source outages
krivard Oct 20, 2020
a30dd99
Merge branch 'main' into geo_refactor_safegraph
chinandrew Oct 20, 2020
29c01e6
Undo previous geo_data_proc changes
dshemetov Oct 21, 2020
34a3585
Update add_population_column
dshemetov Oct 21, 2020
a9c5e63
JHU prop signal fix and refactor
dshemetov Oct 21, 2020
4bf3410
Small smoother updates:
dshemetov Oct 21, 2020
3d0e5c5
remove wildcard imports from test
chinandrew Oct 21, 2020
12aac02
Merge pull request #349 from cmu-delphi/fix-test-imports
krivard Oct 21, 2020
6008371
Merge pull request #320 from cmu-delphi/changehc
krivard Oct 21, 2020
17bc7ab
Download CHC files via sftp
rumackaaron Oct 21, 2020
e4343fc
Modify signal name
rumackaaron Oct 21, 2020
84422b6
Remove static file
chinandrew Oct 21, 2020
6da3598
Add docstrings to test functions
krivard Oct 22, 2020
5994794
Apply suggestions from review
krivard Oct 22, 2020
6e3164d
Change states to lowercase
chinandrew Oct 22, 2020
f4b4eb4
Remove print statement
chinandrew Oct 22, 2020
2904c1d
Merge pull request #343 from cmu-delphi/fix/combo-robustify
krivard Oct 22, 2020
d243e3f
Revert "Revert "Add 7-day average of each signal to Safegraph indicat…
krivard Oct 22, 2020
d266d21
migrate safegraph.run back onto using functools.partial
sgsmob Oct 21, 2020
47a9a26
fix output file format from YYYY-MM-DD to YYYYMMDD
sgsmob Oct 21, 2020
936721e
Merge branch 'krivard/fix-weekday' of github.com:cmu-delphi/covidcast…
sgsmob Oct 22, 2020
9313bfa
Merge pull request #356 from cmu-delphi/krivard/fix-weekday
krivard Oct 22, 2020
ae02415
Update jhu docstring
krivard Oct 22, 2020
af0b3fb
Merge pull request #328 from cmu-delphi/jhu_prop_fix
krivard Oct 22, 2020
638c578
Update comment in download_ftp_files.py
rumackaaron Oct 22, 2020
f03aef5
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 23, 2020
fee7222
add a test for delphi_safegraph.run_module
sgsmob Oct 23, 2020
7f701b4
bring safegraph_patterns more structurally in line with safegraph
sgsmob Oct 23, 2020
67bc0a9
lint and other style cleanups
sgsmob Oct 23, 2020
571d51d
New signal name
rumackaaron Oct 23, 2020
f115859
Code review suggestions
rumackaaron Oct 23, 2020
6d789d8
Merge branch 'changehc' of https://github.com/cmu-delphi/covidcast-in…
rumackaaron Oct 23, 2020
b310fd9
Corrected path to check for previous download
rumackaaron Oct 23, 2020
af7b20c
add pylintrc file to each indicator
sgsmob Oct 23, 2020
a33414c
Fix geomapper
dshemetov Oct 24, 2020
c1fff63
Remove an extra data.copy in geomapper
dshemetov Oct 24, 2020
a1e8ce5
add signal module to delphi_utils
sgsmob Oct 26, 2020
0b94c65
final newline in signal
sgsmob Oct 26, 2020
ce365b7
migrate most indicators to common add_prefix
sgsmob Oct 26, 2020
b27f6da
Add download tests
rumackaaron Oct 26, 2020
c8fe35f
Modify test params
rumackaaron Oct 26, 2020
94a3f56
migrate changehc to common add_prefix library
sgsmob Oct 26, 2020
7f07c41
Merge pull request #233 from cmu-delphi/nchs_mortality
krivard Oct 26, 2020
40c13a7
migrate google_health to the common add_prefix
sgsmob Oct 26, 2020
7c03634
don't delete receiving/.gitignore
sgsmob Oct 26, 2020
c9fea0a
Merge pull request #310 from cmu-delphi/geoutil_state_extension
krivard Oct 26, 2020
0a7865e
Merge pull request #354 from cmu-delphi/lowercase-cdcnet
krivard Oct 26, 2020
869a8d6
Update docs
chinandrew Oct 27, 2020
b485327
Update docs
chinandrew Oct 27, 2020
7248fb4
Improve linting
rumackaaron Oct 27, 2020
5def638
linting for touched cdc_covidnet files
sgsmob Oct 27, 2020
e2b45be
linting updates to changehc
sgsmob Oct 27, 2020
eb085a9
linter updates to combo_cases_and_deaths
sgsmob Oct 27, 2020
66b6948
linter fixes for emr_hosp
sgsmob Oct 27, 2020
f998634
linter updates for google_health
sgsmob Oct 27, 2020
43224f7
linter compliance for quidel
sgsmob Oct 27, 2020
cd3f520
linter compliance for quidel_covidtest
sgsmob Oct 27, 2020
5e26d29
linter compliance for safegraph
sgsmob Oct 27, 2020
c21d5a9
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 27, 2020
21d5662
Merge branch 'main' into signals
sgsmob Oct 27, 2020
adcfdca
removing stray file
sgsmob Oct 27, 2020
363a93a
Merge branch 'signals' of github.com:sgsmob/covidcast-indicators into…
sgsmob Oct 27, 2020
b13c534
Update changehc/tests/test_update_sensor.py
sgsmob Oct 27, 2020
357f207
clarify bool parameter handling
sgsmob Oct 27, 2020
4aba282
remove unnecessary import in test
sgsmob Oct 27, 2020
7e3e516
update bool handling for safegraph_patterns too
sgsmob Oct 27, 2020
9fa3c79
mocking out RPC to covidcast.metadata
sgsmob Oct 27, 2020
d158beb
t pushMerge branch 'signals' of github.com:sgsmob/covidcast-indicator…
sgsmob Oct 27, 2020
60b4a79
Add exception specificaiton
chinandrew Oct 28, 2020
13bd78d
add dependence of delphi_utils on covidcast
sgsmob Oct 28, 2020
d73100f
break out wip signal tests into separate test instances
sgsmob Oct 28, 2020
2f8d4df
Merge pull request #391 from cmu-delphi/add-exceptions
krivard Oct 28, 2020
ddadab2
Merge pull request #363 from sgsmob/aws_credentials
krivard Oct 28, 2020
38a5a10
Merge pull request #378 from cmu-delphi/sg-patterns-docs
krivard Oct 28, 2020
d947887
Merge pull request #352 from cmu-delphi/changehc
krivard Oct 28, 2020
137f795
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 28, 2020
d2a5a23
Merge pull request #376 from cmu-delphi/nchs_mortality-docs
krivard Oct 28, 2020
3aaba75
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 28, 2020
35b97ef
stop pylint recursion error in jhu
sgsmob Oct 28, 2020
4d9c494
stop pylint recursion error in usafacts
sgsmob Oct 28, 2020
fd11ca8
Remove cds and emr_hosp directories
chinandrew Oct 28, 2020
9eb518c
Merge branch 'main' into dv-package
chinandrew Oct 28, 2020
e678651
Merge pull request #394 from cmu-delphi/remove-cds-emr
krivard Oct 28, 2020
330abad
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 28, 2020
7b79c72
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 28, 2020
9359527
Merge pull request #393 from sgsmob/lint_recursion
krivard Oct 28, 2020
dcaf97d
Merge pull request #368 from sgsmob/signals
krivard Oct 28, 2020
4570423
turn on usafacts::test_run
sgsmob Oct 28, 2020
e18c6f6
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 28, 2020
455f1dc
lint compliance
sgsmob Oct 28, 2020
008f530
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 28, 2020
8b3693d
Merge pull request #392 from cmu-delphi/main
krivard Oct 28, 2020
7aa680a
Merge pull request #400 from cmu-delphi/fix_geomapper_popcol
krivard Oct 28, 2020
7cfed72
Add smoother interface for handling pandas Series:
dshemetov Oct 29, 2020
fcfd2ea
pylint shouldn't complain about capital names for matrix operations
sgsmob Oct 29, 2020
c931139
lint compliance for jhu
sgsmob Oct 29, 2020
68692a9
ignore test outputs
sgsmob Oct 29, 2020
7a8e9db
pylint compliance for quidel_covidtest
sgsmob Oct 29, 2020
aba2c85
lint compliance for usafacts
sgsmob Oct 29, 2020
132bcf8
pylint shouldn't complain about non-member function that actually exists
sgsmob Oct 29, 2020
f04d28f
Merge branch 'pylint_google_health' into pylint
sgsmob Oct 29, 2020
51b33de
Merge branch 'pylint_jhu' into pylint
sgsmob Oct 29, 2020
732ae48
Merge branch 'pylint_quidel_covidtest' into pylint
sgsmob Oct 29, 2020
ab0ab6e
Merge branch 'pylint_usafacts' into pylint
sgsmob Oct 29, 2020
7d84fe6
Merge branch 'main' into deploy-jhu
krivard Oct 29, 2020
2884745
Merge pull request #398 from cmu-delphi/deploy-jhu
krivard Oct 29, 2020
7d50e4e
Merge pull request #335 from cmu-delphi/jhu_cruise_ships_fix
krivard Oct 29, 2020
beb5d87
JHU: Appease the linter
krivard Oct 29, 2020
ab3ebf2
Merge pull request #404 from cmu-delphi/fix/deploy-jhu-linter
krivard Oct 29, 2020
28f13cd
Merge pull request #406 from cmu-delphi/deploy-jhu
krivard Oct 29, 2020
bdaa4c0
Merge pull request #407 from cmu-delphi/deploy-safegraph
krivard Oct 29, 2020
a233937
Merge pull request #399 from sgsmob/usa_tests
krivard Oct 29, 2020
6b407bf
Merge branch 'main' of github.com:cmu-delphi/covidcast-indicators int…
sgsmob Oct 30, 2020
8c73df3
Merge pull request #365 from sgsmob/pylint
krivard Oct 30, 2020
6521db3
Merge branch 'main' into geo
krivard Oct 30, 2020
ca046a6
Merge pull request #313 from cmu-delphi/geo_refactor_safegraph
krivard Oct 30, 2020
8a0a2c0
Merge pull request #316 from sgsmob/geo
krivard Oct 30, 2020
dac4baf
don't alter data frames in place in safegraph
sgsmob Nov 2, 2020
1142a77
remove extraneous functions and calls from usafacts
sgsmob Nov 2, 2020
6f671a5
retain gitkeep file
chinandrew Nov 2, 2020
7fe7294
Merge pull request #420 from sgsmob/safegraph
krivard Nov 2, 2020
dd5e3f2
Merge pull request #421 from sgsmob/usafacts
krivard Nov 2, 2020
40c75a7
Merge pull request #422 from cmu-delphi/save-gitkeep
krivard Nov 3, 2020
bab0b51
Merge branch 'main' into dev-smoothing
krivard Nov 3, 2020
92a750c
Merge pull request #176 from cmu-delphi/dev-smoothing
krivard Nov 3, 2020
ef5aef2
Merge branch 'main' into dv-smooth-refactor
chinandrew Nov 5, 2020
06d610d
refactor to use smoothing utility
chinandrew Nov 5, 2020
09c26c3
resize matrices
chinandrew Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
119 changes: 119 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Contributing to COVIDcast indicator pipelines

## Branches

* `main`

The primary/authoritative branch of this repository is called `main`, and contains up-to-date code and supporting libraries. This should be your starting point when creating a new indicator. It is protected so that only reviewed pull requests can be merged in.

* `deploy-*`

Each automated pipeline has a corresponding branch which automatically deploys to a runtime host which runs the pipeline at a designated time each day. New features and bugfixes are merged into this branch using a pull request, so that our CI system can run the lint and test cycles and make sure the package will run correctly on the runtime host. If an indicator does not have a branch named after it starting with `deploy-`, that means the indicator has not yet been automated, and has a designated human keeper who is responsible for making sure the indicator runs each day -- whether that is manually or using a scheduler like cron is the keeper's choice.

* everything else

All other branches are development branches. We don't enforce a naming policy.

## Issues

Issues are the main communication point when it comes to bugfixes, new features, or other possible changes. The repository has several issue templates that help to structure issues.

If you ensure that each issue deals with a single topic (ie a single new proposed data source, or a single data quality problem), we'll all be less likely to drop subordinate tasks on the floor, but we also recognize that a lot of the people filing issues in this repository are new to large project management and not used to focusing their thoughts in this way. It's okay, we'll all learn and get better together.

Admins will assign issues to one or more people based on balancing expediency, expertise, and team robustness. It may be faster for one person to fix something, but we can reduce the risk of having too many single points of failure if two people work on it together.

## Project Boards

The Delphi Engineering team uses project boards to structure its weekly calls and track active tasks.

Immediate work is tracked on [Release Planning](https://github.com/cmu-delphi/covidcast-indicators/projects/2)

Long-term work and modeling collaborations are tracked on [Refactoring](https://github.com/cmu-delphi/covidcast-indicators/projects/3)


## General workflow for indicators creation and deployment

So, how does one go about developing a pipeline for a new data source?

**tl;dr**

1. Create your new indicator branch from `main`.
2. Build it using the appropriate template, following the guidelines in the included README.md and REVIEW.md files.
3. Make some stuff!
4. When your stuff works, push your `dev-*` branch to remote for review.
5. Consult with a platform engineer for the remaining production setup needs. They will create a branch called `deploy-*` for your indicator.
6. Initiate a pull request against this new branch.
7. Following [the source documentation template](https://github.com/cmu-delphi/delphi-epidata/blob/main/docs/api/covidcast-signals/_source-template.md), create public API documentation for the source. You can submit this as a pull request against the delphi-epidata repository.
8. If your peers like the code, the documentation is ready, and Jenkins approves, deploy your changes by merging the PR.
9. An admin will propagate your successful changes to `main`.
10. Rejoice!

### Starting out

The `main` branch should contain up-to-date code and supporting libraries. This should be your starting point when creating a new indicator.

```shell
# Hint
#
git checkout main
git checkout -b dev-my-feature-branch
```

### Creating your indicator

Create a directory for your new indicator by making a copy of `_template_r` or `_template_python` depending on the programming language you intend to use. The template copies of `README.md` and `REVIEW.md` include the minimum requirements for code structure, documentation, linting, testing, and method of configuration. Beyond that, we don't have any established restrictions on implementation; you can look at other existing indicators see some examples of code layout, organization, and general approach.

- Consult your peers with questions! :handshake:

Once you have something that runs locally and passes tests you set up your remote branch eventual review and production deployment.

```shell
# Hint
#
git push -u origin dev-my-feature-branch
```

You can then draft public API documentation for people who would fetch this
data from the API. Public API documentation is kept in the delphi-epidata
repository, and there is a [template Markdown
file](https://github.com/cmu-delphi/delphi-epidata/blob/main/docs/api/covidcast-signals/_source-template.md)
that outlines the features that need to be documented. You can create a pull
request to add a new file to `docs/api/covidcast-signals/` for your source. Our
goal is to have public API documentation for the data at the same time as it
becomes available to the public.

### Setting up for review and deployment

Once you have your branch set up you should get in touch with a platform engineer to pair up on the remaining production needs. These include:

- Creating the corresponding `deploy-*` branch in the repo.
- Adding the necessary Jenkins scripts for your indicator.
- Preparing the runtime host with any Automation configuration necessities.
- Reviewing the workflow to make sure it meets the general guidelines and will run as expected on the runtime host.

Once all the last mile configuration is in place you can create a pull request against the correct `deploy-*` branch to initiate the CI/CD pipeline which will build, test, and package your indicator for deployment.

If everything looks ok, you've drafted source documentation, platform engineering has validated the last mile, and the pull request is accepted, you can merge the PR. Deployment will start automatically.

Hopefully it'll be a full on :tada:, after that :crossed_fingers:

If not, circle back and try again.

## Production overview

### Running production code

Currently, the production indicators all live and run on the venerable and perennially useful Delphi primary server (also known generically as "the runtime host").

### Delivering an indicator to the production environment

We use a branch-based git workflow coupled with [Jenkins](https://www.jenkins.io/) and [Ansible](https://www.ansible.com/) to build, test, package, and deploy each indicator individually to the runtime host.

- Jenkins dutifully manages the whole process for us by executing several "stages" in the context of a [CI/CD pipeline](https://dzone.com/articles/learn-how-to-setup-a-cicd-pipeline-from-scratch). Each stage does something unique, building on the previous stage. The stages are:
- Environment - Sets up some environment-specific needs that the other stages depend on.
- Build - Create the Python venv on the Jenkins host.
- Test - Run linting and unit tests.
- Package - Tar and gzip the built environment.
- Deploy - Trigger an Ansible playbook to place the built package onto the runtime host, place any necessary production configuration, and adjust the runtime envirnemnt (if necessary).

There are several additional Jenkins-specific files that will need to be created for each indicator, as well as some configuration additions to the runtime host. It will be important to pair with a platform engineer to prepare the necessary production environment needs, test the workflow, validate on production, and ultimately sign off on a production release.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/data_quality_issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Data quality issue
about: Missing data, weird data, broken data
title: ''
labels: 'data quality'
assignees: 'nmdefries'
---

**Actual Behavior:**

<!--Provide a description of the problem and a minimal reproducible example, if relevant. Please include the source and signal names, as well as sample observations, with geo region name, date, and data, demonstrating the problem.-->

When I...

**Expected behavior**

<!--A clear and concise description of what you expected to happen.-->

**Context**

<!--Add any context about the problem here.-->
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Feature release
about: Begin the finishing work for features ready to be included in a release
title: 'Release NEW_THING'
labels: 'release'
assignees: 'benjaminysmith'
---

- [Link to issue]()
- [Link to PR]()
- Proposed release version: <!-- eg 1.12 -->

<!-- Additional information about the feature: -->


<!-- relevant for most work -->

- [ ] API [documentation](https://github.com/cmu-delphi/delphi-epidata/tree/main/docs/api) and/or [changelog](https://github.com/cmu-delphi/delphi-epidata/blob/main/docs/api/covidcast_changelog.md)
- [ ] API mailing list notification

<!-- relevant for new signals -->

- [ ] Statistical review (usually [correlations](https://github.com/cmu-delphi/covidcast/tree/main/docs/R-notebooks))
- [ ] Signal / source name review (usually [Roni](https://docs.google.com/document/d/10hGd4Evce4lJ4VkWaQEKFQxvmw2P4xyYGtIAWF52Sf8/edit?usp=sharing))

<!-- relevant for new map signals -->

- [ ] Visual review
- [ ] [Signal description pop-up text](https://docs.google.com/document/d/1kDqRg8EaI4WQXMaUUbbCGPlsUqEql8kgXCNt6AvMA9I/edit?usp=sharing) review
- [ ] [Map release notes](https://docs.google.com/document/d/1BpxGgIma_Lkd2kxtwEo2DBdHQ3zk6dHRz-leUIRlOIA/edit?usp=sharing)
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/source_signal_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🚀 New Source or Signal
about: Suggest incorporation of a new source or signal
title: ''
labels: 'API addition'
assignees: ''
---

<!--A clear and concise description of the source or signal you would like to add or modify, and how you imagine it working.-->

It would be great if ...

**Data details**

<!--Please link and briefly describe the proposed source. How is the raw data made available? Describe the geographic and time resolution of the raw data. Which fields should be extracted? Please describe proposed processing of the data, especially if this is a variant of an existing source or signal. -->

**Additional context**

<!--Add any other context or screenshots about the feature request here.-->
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,17 @@ venv.bak/
# mkdocs documentation
/site

# VSCode settings
*.vscode

# mypy
.mypy_cache/

# Ansible
.retry
.indicators-ansible-vault-pass
indicators-ansible-vault-pass

# testing_utils
testing_utils/cache
testing_utils/*.csv
83 changes: 83 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!groovy

// import shared library: https://github.com/cmu-delphi/jenkins-shared-library
@Library('jenkins-shared-library') _

pipeline {

agent any

stages {

stage ("Environment") {
when {
anyOf {
branch "deploy-*";
changeRequest target: "deploy-*", comparator: "GLOB"
}
}
steps {
script {
// Get the indicator name from the pipeline env.
if ( env.CHANGE_TARGET ) {
INDICATOR = env.CHANGE_TARGET.replaceAll("deploy-", "")
}
else if ( env.BRANCH_NAME ) {
INDICATOR = env.BRANCH_NAME.replaceAll("deploy-", "")
}
else {
INDICATOR = ""
}
}
}
}

stage('Build') {
when {
changeRequest target: "deploy-*", comparator: "GLOB"
}
steps {
sh "jenkins/${INDICATOR}-jenkins-build.sh"
}
}

stage('Test') {
when {
changeRequest target: "deploy-*", comparator: "GLOB"
}
steps {
sh "jenkins/${INDICATOR}-jenkins-test.sh"
}
}

stage('Package') {
when {
changeRequest target: "deploy-*", comparator: "GLOB"
}
steps {
sh "jenkins/${INDICATOR}-jenkins-package.sh"
}
}

stage('Deploy') {
when {
branch "deploy-*"
}
steps {
sh "jenkins/${INDICATOR}-jenkins-deploy.sh"
}
}
}

post {
always {
script {
/*
Use slackNotifier.groovy from shared library and provide current
build result as parameter.
*/
slackNotifier(currentBuild.currentResult)
}
}
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 The Delphi Group at Carnegie Mellon University

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Covidcast Indicators

[![License: MIT][mit-image]][mit-url]

In early April 2020, Delphi developed a uniform data schema for [a new Epidata endpoint focused on COVID-19](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html). Our intent was to provide signals that would track in real-time and in fine geographic granularity all facets of the COVID-19 pandemic, aiding both nowcasting and forecasting. Delphi's long history in tracking and forecasting influenza made us uniquely situated to provide access to data streams not available anywhere else, including medical claims data, electronic medical records, lab test records, massive public surveys, and internet search trends. We also process commonly-used publicly-available data sources, both for user convenience and to provide data versioning for sources that do not track revisions themselves.

Each data stream arrives in a different format using a different delivery technique, be it sftp, an access-controlled API, or an email attachment. The purpose of each pipeline in this repository is to fetch the raw source data, extract informative aggregate signals, and output those signals---which we call **COVID-19 indicators**---in a common format for upload to the [COVIDcast API](https://cmu-delphi.github.io/delphi-epidata/api/covidcast.html).

For client access to the API, along with a variety of other utilities, see our [R](https://cmu-delphi.github.io/covidcast/covidcastR/) and [Python](https://cmu-delphi.github.io/covidcast/covidcast-py/html/) packages.

For interactive visualizations (of a subset of the available indicators), see our [COVIDcast map](https://covidcast.cmu.edu).

## Organization

Utilities:
* `_delphi_utils_python` - common behaviors
* `_template_python` & `_template_r` - starting points for new data sources
* `ansible` & `jenkins` - automated testing and deployment
* `sir_complainsalot` - a Slack bot to check for missing data

Indicator pipelines: all remaining directories.

Each indicator pipeline includes its own documentation.

* Consult README.md for directions to install, lint, test, and run the pipeline for that indicator.
* Consult REVIEW.md for the checklist to use for code reviews.
* Consult DETAILS.md (if present) for implementation details, including handling of corner cases.


## License

This repository is released under the **MIT License**.

[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
[mit-url]: https://opensource.org/licenses/MIT
21 changes: 17 additions & 4 deletions _delphi_utils_python/.pylintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
[DESIGN]

min-public-methods=1
[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

[MESSAGES CONTROL]
[BASIC]

# Allow arbitrarily short-named variables.
variable-rgx=[a-z_][a-z0-9_]*
argument-rgx=[a-z_][a-z0-9_]*

[DESIGN]

disable=R0801, C0330, E1101, E0611, C0114, C0116, C0103, R0913, R0914, W0702
# Don't complain about pytest "unused" arguments.
ignored-argument-names=(_.*|run_as_module)
Loading