Four more pose methods that said they always return a figure - #369
Merged
Conversation
#350's tail: mypy 52 to 50, and the number understates it. Annotating the six `render_*` helpers in `_pose_visualize.py`, which carried no return annotations at all, first pushed the count UP to 54 --- because four public methods in `_pose.py` declared `-> MgFigure` while receiving `MgFigure | None` from them. So `pose_waterfall()`, `pose_segments()`, `pose_center()` and `pose_distance()` have always been able to return None, on too few frames or an empty render, and have always said otherwise. The same shape as the nine audio methods corrected in 1.13.0: the code was right and the description was wrong. Signatures and docstrings now agree with it. Two inference fixes in the same file. `points.append(None)` is deliberate --- a keypoint below the confidence threshold is recorded as absent --- but the list was inferred `list[tuple[int, int]]` from its first append, so the intended None was the error. And `_trail` is a deque or None depending on whether marker history was asked for, unannotated at three sites. 682 tests pass, 4 skipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Continuing the tail of #350. mypy 52 → 50, 682 tests pass.
The number understates this one. Annotating the six
render_*helpers in_pose_visualize.py— which had no return annotations at all — first pushed the count up to 54, because four public methods in_pose.pydeclared-> MgFigurewhile receivingMgFigure | Nonefrom them.So
pose_waterfall(),pose_segments(),pose_center()andpose_distance()have always been able to returnNone— on too few frames, or an empty render — and have always said otherwise. Same shape as the nine audio methods corrected in 1.13.0: the code was right, the description was wrong. Signatures and docstrings now agree with it.Two inference fixes in the same file:
points.append(None)is deliberate, recording a keypoint below the confidence threshold as absent. The list was inferredlist[tuple[int, int]]from its first append, so the intendedNonewas flagged as the error._trailis adequeorNonedepending on whether marker history was requested, unannotated at three sites.Remaining after this: 50.
🤖 Generated with Claude Code