Style Guide#
This page summarises the key coding conventions for PhysicsNeMo Curator.
The authoritative reference is CLAUDE.md in the repository root — consult
it for the full details.
License Headers#
Every source file must include an SPDX license header:
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: Apache-2.0
For Markdown and HTML files use comment syntax appropriate to the format.
Python Conventions#
Formatter / linter: ruff with a line length of 120.
Type checking: All code must pass
ty check.Docstrings: NumPy-style. 99 % coverage enforced by interrogate (excludes
test/anddocs/).Imports: Use
from __future__ import annotationsand gate heavy imports behindTYPE_CHECKING.
Rust Conventions#
Formatter:
rustfmtdefaults viacargo fmt.Linter: clippy with all warnings treated as errors (
-D warnings).
Commit Messages#
All commits use Conventional Commits format:
<type>(<scope>): <short summary>
Types:
feat,fix,refactor,test,docs,style,perf,ci,build,choreScopes (optional):
mesh,da,core,run,cli,rustSummary in imperative mood, lowercase, no trailing period, max 72 chars.
Pre-commit hooks enforce formatting and linting automatically.
Toolchain Quick Reference#
Tool |
Command |
Purpose |
|---|---|---|
ruff |
|
Python lint + format |
ty |
|
Python type checking |
interrogate |
|
Docstring coverage |
cargo fmt |
|
Rust formatting |
clippy |
|
Rust linting |
cargo-deny |
|
Dependency audit |
Run all checks at once with:
make check # format + lint + typecheck + interrogate + deny