Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.89 KB

coding_style.md

File metadata and controls

20 lines (14 loc) · 1.89 KB

Code formatting

We use Black to format our Python code. We use these changes to Black's default settings:

We use Ruff for all other code linting, such as docstrings, import sorting, and flake8. The .ruff.toml in our repository template has the configuration that we use across all our repositories. This also allows easy local usage, as the only command that needs to run is ruff check or ruff --fix for code to be linted and some of the issues auto-fixed.

Docstrings

We use Google-style docstrings.

Unittesting

In terms of requirements around unittesting etc, please see our Pull Request template (which lists all the criteria we hope each pull request satisfies).

Jupyter Notebooks

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!)

Spelling

We use American English in our code (for example, so we use 'center' rather than 'centre'). This is true for variable namings and docstrings.

Repository Template

If making a new OCF Repository, please try using our template here which should help with boilerplate linting and setup.