Skip to content

Commit 34d795d

Browse files
committed
add make doctest and instructions to contributing
1 parent e2760bc commit 34d795d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

CONTRIBUTING.md

+14
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ We recommend that your contribution complies with the following guidelines befor
121121

122122
- All public methods must have informative docstrings with sample usage when appropriate.
123123

124+
- Example usage in docstrings is tested via doctest, which can be run via
125+
126+
```bash
127+
make doctest
128+
```
129+
130+
- Doctest can also be run directly via pytest, which can be helpful to run only specific tests during development. The following commands run all doctests, only doctests in the pymc_models module, and only the doctests for the `ModelBuilder` class in pymc_models:
131+
132+
```bash
133+
pytest --doctest-modules causalpy/
134+
pytest --doctest-modules causalpy/pymc_models.py
135+
pytest --doctest-modules causalpy/pmyc_models.py::causalpy.pymc_models.ModelBuilder
136+
```
137+
124138
- To indicate a work in progress please mark the PR as `draft`. Drafts may be useful to (1) indicate you are working on something to avoid duplicated work, (2) request broad review of functionality or API, or (3) seek collaborators.
125139

126140
- All other tests pass when everything is rebuilt from scratch. Tests can be run with:

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ check_lint:
1717
nbqa isort --check-only .
1818
interrogate .
1919

20+
doctest:
21+
pip install causalpy[test]
22+
pytest --doctest-modules causalpy/
23+
2024
test:
2125
pip install causalpy[test]
2226
pytest

0 commit comments

Comments
 (0)