We use Black to format our Python code. We use these changes to Black's default settings:
max-line-length = 100
(why do we allow up to 100 characters per line, unlike a lot of Python code that limits lines to 80 characters? For the same reason that Linus Torvalds recently changed the Linux kernel coding guidelines to allow up to 100 characters per line :) )
We use Google-style docstrings.
In terms of requirements around unittesting etc, please see our Pull Request template (which lists all the criteria we hope each pull request satisfies).
For now, we maintain the .py
files, and try to ensure they're all internally consistent, but we don't promise to maintain all our notebooks! (That might change if our code starts being used by lots of people!)
We use American English in our code (for example, so we use 'center' rather than 'centre'). This is true for variable namings and docstrings.
If making a new OCF Repository, please try using our template here which should help with boilerplate linting and setup.
- publish black config file
- find a good way to automatically check that docstrings comply with Google style
- Change to using
ruff
for most linting - Repo template