Fix viz.py type hints: optional waypoints + rotate_90cc annotations#95
Open
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
Open
Fix viz.py type hints: optional waypoints + rotate_90cc annotations#95lonexreb wants to merge 1 commit intoNVlabs:mainfrom
lonexreb wants to merge 1 commit intoNVlabs:mainfrom
Conversation
Two small type-annotation hygiene nits in src/alpamayo_r1/visualization/viz.py: - viz_waypoints_pai declares `waypoints_gt: np.ndarray` and `waypoints_pred: np.ndarray` (non-Optional), but the docstring explicitly says "or None to skip" for both, and the body guards `if waypoints_gt is not None` / `if waypoints_pred is not None` before drawing. Update the annotations to `np.ndarray | None` so type checkers agree with the documented contract. - rotate_90cc has no annotations on either parameter or return value. Add `xy: np.ndarray -> np.ndarray` and a short docstring noting the expected shape, matching the style of make_image_grid above it. Pure typing/docstring change. No runtime behavior change. Signed-off-by: lonexreb <[email protected]>
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.
Problem
Two small type-annotation hygiene nits in
src/alpamayo_r1/visualization/viz.py:1.
viz_waypoints_paiannotates non-optional but accepts None.Signature:
Docstring:
Body:
Type checkers reject the documented
Noneusage outright.2.
rotate_90cchas no annotations.The neighboring
make_image_gridis fully annotated;rotate_90ccis the odd one out.Fix
Pure typing/docstring change. No runtime behavior change.
viz_waypoints_paiparameters tonp.ndarray | None.rotate_90ccasxy: np.ndarray -> np.ndarrayand add a short Args/Returns block noting the expected(2, N)shape.