docs: docstrings for CanonicalMcapWriter public methods and DiagnosticLevel - #55
Closed
chintondutta wants to merge 1 commit into
Closed
Conversation
…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.
|
👋 Hi @chintondutta — thanks for the contribution! To keep starter issues available You already have #52 open, so this one is being closed automatically. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11.
The gap
CanonicalMcapWriteris exported inhflow.__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.DiagnosticLevelwas 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.
ChannelDataproperties inepisode.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 forDiagnosticLevel.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