Skip to content

Commit fd0dcb6

Browse files
author
Ashley Scillitoe
authored
Update CONTRIBUTING.md with guidance on class docstrings (#743)
1 parent 7c5e48c commit fd0dcb6

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ mypy alibi
5858
## Docstrings
5959
We adhere to the `numpy` style docstrings (https://numpydoc.readthedocs.io/en/stable/format.html)
6060
with the exception of ommiting argument types in docstrings in favour of type hints in function
61-
and class signatures. If you're using a `PyCharm`, you can configure this under
62-
`File -> Settings -> Tools -> Python Integrated Tools -> Docstrings`.
61+
and class signatures. If you use an IDE, you may be able to configure it to assist you with writing
62+
docstrings in the correct format. For `PyCharm`, you can configure this under
63+
`File -> Settings -> Tools -> Python Integrated Tools -> Docstrings`. For `Visual Studio Code`, you can obtain
64+
docstring generator extensions from the [VisualStudio Marketplace](https://marketplace.visualstudio.com/).
65+
66+
When documenting Python classes, we adhere to the convention of including docstrings in their `__init__` method,
67+
rather than as a class level docstring. Docstrings should only be included at the class-level if a class does
68+
not posess an `__init__` method, for example because it is a static class.
6369

6470
#### Conventions
6571

@@ -237,4 +243,4 @@ Checklist to run through before a PR is considered complete:
237243
- [Documentation](#building-documentation) is built locally and checked for errors/warning in the build log and any issues in the final docs, including API docs.
238244
- For any new functionality or new examples, appropriate links are added (`README.md`, `doc/source/index.rst`, `doc/source/overview/getting_started.md`,`doc/source/overview/algorithms.md`, `doc/source/examples`), see [Documentation for alibi](doc/README.md) for more information.
239245
- For any changes to existing algorithms, run the example notebooks manually and check that everything still works as expected and there are no extensive warnings/outputs from dependencies.
240-
- Any changes to dependencies are reflected in the appropriate place (`setup.py` for runtime and optional dependencies, `requirements/dev.txt` for development dependencies and `requirements/doc.txt` for documentation dependencies).
246+
- Any changes to dependencies are reflected in the appropriate place (`setup.py` for runtime and optional dependencies, `requirements/dev.txt` for development dependencies and `requirements/doc.txt` for documentation dependencies).

0 commit comments

Comments
 (0)