Skip to content

Commit 3a97ea4

Browse files
authored
Merge pull request #997 from cmu-delphi/utils-docs
Add LICENSE and update README for utils
2 parents fb17d0a + e7b7e61 commit 3a97ea4

File tree

3 files changed

+96
-56
lines changed

3 files changed

+96
-56
lines changed

_delphi_utils_python/DEVELOP.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# DELPHI Common Utility Functions (Python)
2+
3+
This directory 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+
```

_delphi_utils_python/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021 The Delphi Group at Carnegie Mellon University
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

_delphi_utils_python/README.md

Lines changed: 19 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,19 @@
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

Comments
 (0)