77The indicator is run by directly executing the Python module contained in this
88directory. The safest way to do this is to create a virtual environment,
99installed 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+
1919All of the user-changable parameters are stored in ` params.json ` . To execute
2020the module and produce the output datasets (by default, in ` receiving ` ), run
2121the following:
@@ -24,34 +24,39 @@ the following:
2424env/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-
4745Unit tests are also included in the module. To execute these, run the following
4846command 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
5458The 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