Code Style¶
Ruff for linting and formatting (configured in
pyproject.toml)All functions require type annotations
Google-style docstrings in imperative mood (“Return”, not “Returns”)
Use
# ty: ignore[error-code]for type suppression (never# type: ignore)Never use
from __future__ import annotations
Testing¶
Plain
pytestfunctions — no test classesUse
@pytest.mark.parametrizefor test variations
Naming¶
funcfor callable abbreviations (neverfn)state_names/action_names(notstates_names)arg_names(notargument_names)
Plotting¶
Always use plotly (
plotly.graph_objects,plotly.subplots.make_subplots), never matplotlib
Docstrings¶
MyST syntax (single backticks for code,
$...$for math), not reStructuredTextInline field docstrings (PEP 257) for dataclass attributes
Docstring types must match annotations (
Mappingnot “Dict” when annotation isMapping)