|
1 |
| -# DELPHI Common Utility Functions (Python) |
2 |
| - |
3 |
| -This director contains the Python module `delphi_utils`. It includes a number of |
4 |
| -common functions that are useful across multiple indicators. |
5 |
| - |
6 |
| -## Installing the Module |
7 |
| - |
8 |
| -To install the module in your default version of Python, run the |
9 |
| -following from this directory: |
10 |
| - |
11 |
| -``` |
12 |
| -pip install . |
13 |
| -``` |
14 |
| - |
15 |
| -As described in each of the indicator code directories, you will want to install |
16 |
| -this module within a virtual environment when testing the various code bases. |
17 |
| - |
18 |
| -### Testing the code |
19 |
| - |
20 |
| -To do a static test of the code style, it is recommended to run **pylint** on |
21 |
| -the module. To do this, run the following from the main module directory: |
22 |
| - |
23 |
| -``` |
24 |
| -pylint delphi_utils |
25 |
| -``` |
26 |
| - |
27 |
| -The most aggressive checks are turned off; only relatively important issues |
28 |
| -should be raised and they should be manually checked (or better, fixed). |
29 |
| - |
30 |
| -Unit tests are also included in the module. These should be run by first |
31 |
| -installing the module into a virtual environment: |
32 |
| - |
33 |
| -``` |
34 |
| -python -m venv env |
35 |
| -source env/bin/activate |
36 |
| -pip install . |
37 |
| -``` |
38 |
| - |
39 |
| -And then running the unit tests with: |
40 |
| - |
41 |
| -``` |
42 |
| -(cd tests && ../env/bin/pytest --cov=delphi_utils --cov-report=term-missing) |
43 |
| -``` |
44 |
| - |
45 |
| -The output will show the number of unit tests that passed and failed, along |
46 |
| -with the percentage of code covered by the tests. None of the tests should |
47 |
| -fail and the code lines that are not covered by unit tests should be small and |
48 |
| -should not include critical sub-routines. |
49 |
| - |
50 |
| -When you are finished, the virtual environment can be deactivated and |
51 |
| -(optionally) removed. |
52 |
| - |
53 |
| -``` |
54 |
| -deactivate |
55 |
| -rm -r env |
56 |
| -``` |
| 1 | +# Delphi Python Utilities |
| 2 | + |
| 3 | +This package provides various utilities used by the [Delphi group](https://delphi.cmu.edu/) at [Carnegie Mellon |
| 4 | +University](https://www.cmu.edu) for its data pipelines and analyses. |
| 5 | + |
| 6 | +Submodules: |
| 7 | +- `validator`: Data sanity checks and anomaly detection. |
| 8 | +- `archive`: Diffing and archiving CSV files. |
| 9 | +- `export`: DataFrame to CSV export. |
| 10 | +- `geomap`: Mappings between geographic resolutions. |
| 11 | +- `logger`: Structured JSON logger. |
| 12 | +- `runner`: Orchestrator for running an indicator pipeline. |
| 13 | +- `signal`: Indicator (signal) naming. |
| 14 | +- `slack_notifier`: Slack notification integration. |
| 15 | +- `smooth`: Data smoothing functions. |
| 16 | +- `utils`: JSON parameter interactions. |
| 17 | + |
| 18 | +Source code can be found here: |
| 19 | +[https://github.com/cmu-delphi/covidcast-indicators/](https://github.com/cmu-delphi/covidcast-indicators/) |
0 commit comments