-
Notifications
You must be signed in to change notification settings - Fork 5
Python Code Style
We make use of PEP-8 for our basic code style but there are some issues on which it is silent. There are other matters which are not style in the strictest sense but are requirements we have of our code.
The current state of the code is not as good as we would like. We would like to avoid sweeping re-styling changes so we operate a "you touch it, you fix it" policy.
This means that if you modify any part of a file you are expected restyle the whole file in line with PEP-8 and these additional requirements.
More generally, do not feel afraid of improving the documentation if you see an opportunity. Code style is more down to personal taste so only change it if it fails validation or these directives.
Static type checking (we use mypy
) is a valuable tool for avoiding errors.
In order to gain this advantage we need type hints to be provided on all function arguments.
We make use of the Sphinx tool's ability to automatically generate API documentation from doc-strings. This uses certain reStructured text notation to add structured information.
Python does not consider double (") and single (') quotes semantically different. Which to use is down to local choice.
The rule of thumb is that natural language (such as doc-strings, prompts
and log messages) should use double-quotes. Meanwhile programatic strings
such as those specified in APIs (e.g. str(..., encoding='utf8')
) should
use single quotes.
- Future Release
- vn1.0 Release, March 2023
- 0.11 Beta Release, Jan 2023
- 0.10 Beta Release, Oct 2022
- 0.9 Alpha Release, June 2022
- 2.0, July 2025
- 2.1, August 2025
- Phase 2
- Phase 3
- Phase 4
- Repository Management
- Development Process
- Development Environment
- Releasing Fab
- Coding Conventions
- Glossary
- Concerning the Database
- Unit Test Coverage
- Issues With the System Testing Framework