2 This work is licensed under a Creative Commons Attribution 4.0 International License.
3 http://creativecommons.org/licenses/by/4.0
10 Abide by [PEP-8] for general code. Some particular points to note:
12 * Wrap code at 79 characters.
13 * Use only spaces - no tabs.
14 * Use implicit string concatenation where possible. Don't use the escape
15 character unless absolutely necessary.
16 * Be liberal in your use of whitespace to group related statements together.
17 However, don't leave a space after the docstring and the first statement.
18 * Use single quotes for all string literals.
22 Follow [PEP-257] and the [Sphinx guidelines] for documentation. In particular:
24 * Wrap docstrings at 72 characters.
25 * Use double-quotes for all docstrings.
26 * Write all inline comments in lower-case, except where using a name/initialism.
27 * Document **all** library functions/classes completely. Tests, however, only need a test case docstring.
29 To summarise the docstring conventions:
32 def my_function(athing, stuff=5):
34 Summary line here in imperative tense.
36 Longer description here...
38 :param athing: Details about this paramter here
48 All code should be checked with the PyLint linter and PEP8 style guide checker.
49 Pylint can be run like so:
52 pylint <file or directory>
55 Most PyLint errors should be resolved. You will need to do this manually.
56 However, there are cases where they may not make sense (e.g. you **need** to
57 pass `N` parameters to a function). In this case, disable the relevant
58 case using an inline `disable` like so:
61 # pylint: disable=[code]
64 On the other hand, all PEP8 errors should be resolved.
68 [PEP-8]: http://legacy.python.org/dev/peps/pep-0008/
69 [PEP-257]: http://legacy.python.org/dev/peps/pep-0257/
70 [Sphinx guidelines]: https://pythonhosted.org/an_example_pypi_project/sphinx.html