Skip to content

Commit 6d7386d

Browse files
authored
Merge pull request #482 from cmu-delphi/update-readmes
Update READMEs with make commands
2 parents b0fa4db + 92680cc commit 6d7386d

File tree

14 files changed

+331
-270
lines changed

14 files changed

+331
-270
lines changed

_template_python/README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
The indicator is run by directly executing the Python module contained in this
88
directory. The safest way to do this is to create a virtual environment,
99
installed the common DELPHI tools, and then install the module and its
10-
dependencies. To do this, run the following code from this directory:
10+
dependencies. To do this, run the following command from this directory:
1111

1212
```
13-
python -m venv env
14-
source env/bin/activate
15-
pip install ../_delphi_utils_python/.
16-
pip install .
13+
make install
1714
```
1815

16+
This command will install the package in editable mode, so you can make changes that
17+
will automatically propagate to the installed package.
18+
1919
All of the user-changable parameters are stored in `params.json`. To execute
2020
the module and produce the output datasets (by default, in `receiving`), run
2121
the following:
@@ -24,34 +24,39 @@ the following:
2424
env/bin/python -m delphi_NAME
2525
```
2626

27-
Once you are finished with the code, you can deactivate the virtual environment
28-
and (optionally) remove the environment itself.
27+
If you want to enter the virtual environment in your shell,
28+
you can run `source env/bin/activate`. Run `deactivate` to leave the virtual environment.
29+
30+
Once you are finished, you can remove the virtual environment and
31+
params file with the following:
2932

3033
```
31-
deactivate
32-
rm -r env
34+
make clean
3335
```
3436

3537
## Testing the code
3638

37-
To do a static test of the code style, it is recommended to run **pylint** on
38-
the module. To do this, run the following from the main module directory:
39+
To run static tests of the code style, run the following command:
3940

4041
```
41-
env/bin/pylint delphi_NAME
42+
make lint
4243
```
4344

44-
The most aggressive checks are turned off; only relatively important issues
45-
should be raised and they should be manually checked (or better, fixed).
46-
4745
Unit tests are also included in the module. To execute these, run the following
4846
command from this directory:
4947

5048
```
51-
(cd tests && ../env/bin/pytest --cov=delphi_NAME --cov-report=term-missing)
49+
make test
50+
```
51+
52+
To run individual tests, run the following:
53+
54+
```
55+
(cd tests && ../env/bin/pytest <your_test>.py --cov=delphi_NAME --cov-report=term-missing)
5256
```
5357

5458
The output will show the number of unit tests that passed and failed, along
55-
with the percentage of code covered by the tests. None of the tests should
56-
fail and the code lines that are not covered by unit tests should be small and
57-
should not include critical sub-routines.
59+
with the percentage of code covered by the tests.
60+
61+
None of the linting or unit tests should fail, and the code lines that are not covered by unit tests should be small and
62+
should not include critical sub-routines.

cdc_covidnet/README.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ installed the common DELPHI tools, and then install the module and its
1010
dependencies. To do this, run the following code from this directory:
1111

1212
```
13-
python -m venv env
14-
source env/bin/activate
15-
pip install ../_delphi_utils_python/.
16-
pip install .
13+
make install
1714
```
1815

16+
This command will install the package in editable mode, so you can make changes that
17+
will automatically propagate to the installed package.
18+
1919
All of the user-changable parameters are stored in `params.json`.
2020

2121
The module has to request for each participating state's hospitalization data
@@ -32,35 +32,39 @@ the following:
3232
env/bin/python -m delphi_cdc_covidnet
3333
```
3434

35-
Once you are finished with the code, you can deactivate the virtual environment
36-
and (optionally) remove the environment itself.
35+
If you want to enter the virtual environment in your shell,
36+
you can run `source env/bin/activate`. Run `deactivate` to leave the virtual environment.
37+
38+
Once you are finished, you can remove the virtual environment and
39+
params file with the following:
3740

3841
```
39-
deactivate
40-
rm -r env
42+
make clean
4143
```
4244

4345
## Testing the code
4446

45-
To do a static test of the code style, it is recommended to run **pylint** on
46-
the module. To do this, run the following from the main module directory:
47+
To run static tests of the code style, run the following command:
4748

4849
```
49-
env/bin/pylint delphi_cdc_covidnet
50+
make lint
5051
```
5152

52-
The most aggressive checks are turned off; only relatively important issues
53-
should be raised and they should be manually checked (or better, fixed).
54-
5553
Unit tests are also included in the module. To execute these, run the following
5654
command from this directory:
57-
(Note: the following command requires python 3.8, having any version less than 3.8 might
58-
fail some test cases. Please install it before running.)
55+
5956
```
60-
(cd tests && ../env/bin/pytest --cov=delphi_cdc_covidnet --cov-report=term-missing)
57+
make test
58+
```
59+
60+
To run individual tests, run the following:
61+
62+
```
63+
(cd tests && ../env/bin/pytest <your_test>.py --cov=delphi_cdc_covidnet --cov-report=term-missing)
6164
```
6265

6366
The output will show the number of unit tests that passed and failed, along
64-
with the percentage of code covered by the tests. None of the tests should
65-
fail and the code lines that are not covered by unit tests should be small and
66-
should not include critical sub-routines.
67+
with the percentage of code covered by the tests.
68+
69+
None of the linting or unit tests should fail, and the code lines that are not covered by unit tests should be small and
70+
should not include critical sub-routines.

changehc/README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ installed the common DELPHI tools, and then install the module and its
1414
dependencies. To do this, run the following code from this directory:
1515

1616
```
17-
python -m venv env
18-
source env/bin/activate
19-
pip install ../_delphi_utils_python/.
20-
pip install .
17+
make install
2118
```
2219

20+
This command will install the package in editable mode, so you can make changes that
21+
will automatically propagate to the installed package.
22+
2323
*Note*: you may need to install blas, in Ubuntu do
2424
```
2525
sudo apt-get install libatlas-base-dev gfortran
@@ -33,37 +33,43 @@ the following:
3333
env/bin/python -m delphi_changehc
3434
```
3535

36-
Once you are finished with the code, you can deactivate the virtual environment
37-
and (optionally) remove the environment itself.
36+
If you want to enter the virtual environment in your shell,
37+
you can run `source env/bin/activate`. Run `deactivate` to leave the virtual environment.
38+
39+
Once you are finished, you can remove the virtual environment and
40+
params file with the following:
3841

3942
```
40-
deactivate
41-
rm -r env
43+
make clean
4244
```
4345

4446
## Testing the code
4547

46-
To do a static test of the code style, it is recommended to run **pylint** on
47-
the module. To do this, run the following from the main module directory:
48+
To run static tests of the code style, run the following command:
4849

4950
```
50-
env/bin/pylint delphi_changehc
51+
make lint
5152
```
5253

53-
The most aggressive checks are turned off; only relatively important issues
54-
should be raised and they should be manually checked (or better, fixed).
55-
5654
Unit tests are also included in the module. To execute these, run the following
5755
command from this directory:
5856

5957
```
60-
(cd tests && ../env/bin/pytest --cov=delphi_changehc --cov-report=term-missing)
58+
make test
59+
```
60+
61+
To run individual tests, run the following:
62+
63+
```
64+
(cd tests && ../env/bin/pytest <your_test>.py --cov=delphi_changehc --cov-report=term-missing)
6165
```
6266

6367
The output will show the number of unit tests that passed and failed, along
64-
with the percentage of code covered by the tests. None of the tests should
65-
fail and the code lines that are not covered by unit tests should be small and
66-
should not include critical sub-routines.
68+
with the percentage of code covered by the tests.
69+
70+
None of the linting or unit tests should fail, and the code lines that are not covered by unit tests should be small and
71+
should not include critical sub-routines.
72+
6773

6874
## Code tour
6975

claims_hosp/README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ installed the common DELPHI tools, and then install the module and its
1212
dependencies. To do this, run the following code from this directory:
1313

1414
```
15-
python -m venv env
16-
source env/bin/activate
17-
pip install ../_delphi_utils_python/.
18-
pip install .
15+
make install
1916
```
2017

18+
This command will install the package in editable mode, so you can make changes that
19+
will automatically propagate to the installed package.
20+
2121
All of the user-changable parameters are stored in `params.json`. To execute
2222
the module and produce the output datasets (by default, in `receiving`), run
2323
the following:
@@ -26,37 +26,42 @@ the following:
2626
env/bin/python -m delphi_claims_hosp
2727
```
2828

29-
Once you are finished with the code, you can deactivate the virtual environment
30-
and (optionally) remove the environment itself.
29+
If you want to enter the virtual environment in your shell,
30+
you can run `source env/bin/activate`. Run `deactivate` to leave the virtual environment.
31+
32+
Once you are finished, you can remove the virtual environment and
33+
params file with the following:
3134

3235
```
33-
deactivate
34-
rm -r env
36+
make clean
3537
```
3638

3739
## Testing the code
3840

39-
To do a static test of the code style, it is recommended to run **pylint** on
40-
the module. To do this, run the following from the main module directory:
41+
To run static tests of the code style, run the following command:
4142

4243
```
43-
env/bin/pylint delphi_claims_hosp
44+
make lint
4445
```
4546

46-
The most aggressive checks are turned off; only relatively important issues
47-
should be raised and they should be manually checked (or better, fixed).
48-
4947
Unit tests are also included in the module. To execute these, run the following
5048
command from this directory:
5149

5250
```
53-
(cd tests && ../env/bin/pytest --cov=delphi_claims_hosp --cov-report=term-missing)
51+
make test
52+
```
53+
54+
To run individual tests, run the following:
55+
56+
```
57+
(cd tests && ../env/bin/pytest <your_test>.py --cov=delphi_claims_hosp --cov-report=term-missing)
5458
```
5559

5660
The output will show the number of unit tests that passed and failed, along
57-
with the percentage of code covered by the tests. None of the tests should
58-
fail and the code lines that are not covered by unit tests should be small and
59-
should not include critical sub-routines.
61+
with the percentage of code covered by the tests.
62+
63+
None of the linting or unit tests should fail, and the code lines that are not covered by unit tests should be small and
64+
should not include critical sub-routines.
6065

6166

6267
## Code tour

combo_cases_and_deaths/README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ installed the common DELPHI tools, and then install the module and its
1010
dependencies. To do this, run the following code from this directory:
1111

1212
```
13-
python -m venv env
14-
source env/bin/activate
15-
pip install ../_delphi_utils_python/.
16-
pip install .
13+
make install
1714
```
1815

16+
This command will install the package in editable mode, so you can make changes that
17+
will automatically propagate to the installed package.
18+
1919
All of the user-changable parameters are stored in `params.json`. To execute
2020
the module and produce the output datasets (by default, in `receiving`), run
2121
the following:
@@ -24,34 +24,39 @@ the following:
2424
env/bin/python -m delphi_combo_cases_and_deaths
2525
```
2626

27-
Once you are finished with the code, you can deactivate the virtual environment
28-
and (optionally) remove the environment itself.
27+
If you want to enter the virtual environment in your shell,
28+
you can run `source env/bin/activate`. Run `deactivate` to leave the virtual environment.
29+
30+
Once you are finished, you can remove the virtual environment and
31+
params file with the following:
2932

3033
```
31-
deactivate
32-
rm -r env
34+
make clean
3335
```
3436

3537
## Testing the code
3638

37-
To do a static test of the code style, it is recommended to run **pylint** on
38-
the module. To do this, run the following from the main module directory:
39+
To run static tests of the code style, run the following command:
3940

4041
```
41-
env/bin/pylint delphi_combo_cases_and_deaths
42+
make lint
4243
```
4344

44-
The most aggressive checks are turned off; only relatively important issues
45-
should be raised and they should be manually checked (or better, fixed).
46-
4745
Unit tests are also included in the module. To execute these, run the following
4846
command from this directory:
4947

5048
```
51-
(cd tests && ../env/bin/pytest --cov=delphi_combo_cases_and_deaths --cov-report=term-missing)
49+
make test
50+
```
51+
52+
To run individual tests, run the following:
53+
54+
```
55+
(cd tests && ../env/bin/pytest <your_test>.py --cov=delphi_combo_cases_and_deaths --cov-report=term-missing)
5256
```
5357

5458
The output will show the number of unit tests that passed and failed, along
55-
with the percentage of code covered by the tests. None of the tests should
56-
fail and the code lines that are not covered by unit tests should be small and
57-
should not include critical sub-routines.
59+
with the percentage of code covered by the tests.
60+
61+
None of the linting or unit tests should fail, and the code lines that are not covered by unit tests should be small and
62+
should not include critical sub-routines.

0 commit comments

Comments
 (0)