Skip to content

Formatting and style

Code

We recommend adhering to PEP 8 and using linters like ruff to ensure clean, readable code. Beyond these conventions, we highly encourage writing self-documenting code with meaningful names that make the code's intent clear.

For example, avoid writing code with cryptic variable names like this:

documented-code.py
# Calculate the velocity v
def v(d: float, t: float) -> float:
  """Calculates the velocity from distance and time."""
  # distance is d
  # time is t
  return d / t

Instead, use meaningful variable and function names to write code that is easier to read and less error prone:

self-documenting-code.py
def velocity(distance: float, time: float) -> float:
  """Calculates the velocity from distance and time."""
  return distance / time

Documentation

This documentation is built using zensical. The main documentation source files are written in Markdown, while API documentation is generated from docstrings in the source code via the mkdocstrings plugin. Please write docstrings using the Google style.