Skip to content

docs: docstrings for CanonicalMcapWriter public methods and DiagnosticLevel - #55

Closed
chintondutta wants to merge 1 commit into
Hebbian-Robotics:mainfrom
chintondutta:docs/11-mcap-writer-and-diagnosticlevel-docstrings
Closed

docs: docstrings for CanonicalMcapWriter public methods and DiagnosticLevel#55
chintondutta wants to merge 1 commit into
Hebbian-Robotics:mainfrom
chintondutta:docs/11-mcap-writer-and-diagnosticlevel-docstrings

Conversation

@chintondutta

Copy link
Copy Markdown
Contributor

Fixes #11.

The gap

CanonicalMcapWriter is exported in hflow.__all__, but its public methods had no docstrings -- the only exported class in the API with that gap: register_schema, register_channel, write_message, add_metadata, add_attachment, finish. DiagnosticLevel was the only exported class with no class docstring (its members were commented inline instead).

Change

Added one docstring per method stating its contract (what it returns, what must already be registered, ordering rules), matching the existing tone in the codebase (e.g. ChannelData properties in episode.py, CanonicalMcapWriter.abort() in the same file): one line of contract plus notable caveats, not a restatement of the implementation. finish()'s docstring in particular documents the ordering rule -- must be called last, every other public method raises afterward -- since the guard (_raise_if_finished) is the enforcement but wasn't stated as a contract anywhere. Added a one-line class docstring for DiagnosticLevel.

No behavior changes.

Testing

uv run pytest -q       # 297 passed, 3 skipped; unrelated: tests/test_ffmpeg.py fails/errors in this sandbox (no ffmpeg/ffprobe on PATH)
uv run ruff check --fix
uv run ruff format
uv run ty check

…cLevel

Both were the only exported members of hflow.__all__ without one. Each
docstring states the method's contract (what it returns, ordering rules,
what must already be registered) rather than restating its implementation.
No behavior changes.
@github-actions

Copy link
Copy Markdown

👋 Hi @chintondutta — thanks for the contribution! To keep starter issues available
for other contributors and give every pull request a real review, we accept
1 open pull request per contributor at a time.

You already have #52 open, so this one is being closed automatically.
Once your open pull request is merged or closed, feel free to reopen this one —
no work is lost.

@github-actions github-actions Bot closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: docstrings for CanonicalMcapWriter public methods and DiagnosticLevel

1 participant