Skip to content

Commit 586ceea

Browse files
author
Ashley Scillitoe
authored
Update CONTRIBUTING.md (#595)
Expand guidance on docstrings for classes.
1 parent 0bbe586 commit 586ceea

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ options are defined in `setup.cfg`.
3636
## Docstrings
3737
We adhere to the `numpy` style docstrings (https://numpydoc.readthedocs.io/en/stable/format.html)
3838
with the exception of ommiting argument types in docstrings in favour of type hints in function
39-
and class signatures. If you're using a `PyCharm`, you can configure this under
40-
`File -> Settings -> Tools -> Python Integrated Tools -> Docstrings`.
39+
and class signatures. If you use an IDE, you may be able to configure it to assist you with writing
40+
docstrings in the correct format. For `PyCharm`, you can configure this under
41+
`File -> Settings -> Tools -> Python Integrated Tools -> Docstrings`. For `Visual Studio Code`, you can obtain
42+
docstring generator extensions from the [VisualStudio Marketplace](https://marketplace.visualstudio.com/).
43+
44+
When documenting Python classes, we adhere to the convention of including docstrings in their `__init__` method,
45+
rather than as a class level docstring. Docstrings should only be included at the class-level if a class does
46+
not posess an `__init__` method, for example because it is a static class.
4147

4248
## Building documentation
4349
We use `sphinx` for building documentation. You can call `make build_docs` from the project root,
@@ -104,4 +110,4 @@ replaced with an instance of the MissingDependency class. For example:
104110
...
105111
```
106112
- Developers can use `make repl tox-env=<tox-env-name>` to run a python REPL with the specified optional dependency
107-
installed. This is to allow manual testing.
113+
installed. This is to allow manual testing.

0 commit comments

Comments
 (0)