Full type annotations + Doxygen docs; pyright clean - #10
Merged
Conversation
Adds complete type annotations and Doxygen-style documentation across the package, and makes the `marinholab` package pass pyright (standard mode) with 0 errors / 0 warnings. Python: - _impl.py, icra2019_controller.py, needle_controller.py: full parameter/ return annotations, Doxygen Args/Returns/Raises docstrings, module docstrings. Fixed real type bugs: np.array -> np.ndarray, bare-tuple return types -> Tuple[...], last_x/last_Jx/last_error -> Optional[...], constraint_counter possibly-unbound, ns_vessel -> list[DQ] | None. - examples + saul/insertion_1.py: module/function docstrings + annotations. - _core.pyi: fixed the self-referential ActuationType type alias (ClassVar[type["ActuationType"]]). C++ (Doxygen @file/@brief/@param/@return/@throws): - include/M3_SerialManipulatorSimulatorFriendly.h - src/M3_SerialManipulatorSimulatorFriendly.cpp (protected helpers) Tooling: - stubs/dqrobotics/: closed-set .pyi stubs for the untyped third-party dqrobotics package so pyright can fully check the code without weakening the checks; wired via stubPath in pyproject.toml. - AGENTS.md: documented the pyright/stubs workflow and the annotation + Doxygen conventions; fixed stale test/CI references. No behavioral change: all logic preserved (verified by diff + a rebuild + runtime smoke test of the controller API). Co-authored-by: openhands <openhands@all-hands.dev>
mmmarinho
marked this pull request as ready for review
August 24, 2026 16:14
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.
Summary
Follow-up to #9: makes the merged code fully annotated and checkable with pyright and adds Doxygen-style documentation everywhere it was missing.
0 errors, 0 warnings(standard mode, 7 files analyzed — was 129 errors / 4 warnings before this work).origin/main(differences are annotations/docstrings/type-safety guards only), a full rebuild of the_coreextension from the new C++ sources, and a runtime smoke test of the controller API.Changes
Python (full annotations + Doxygen docstrings)
marinholab/working/needlemanipulation/_impl.py,icra2019_controller.py,needle_controller.py: complete parameter/return annotations,Args:/Returns:/Raises:docstrings, module docstrings.np.arrayused as a type →np.ndarray-> (A, B)) →Tuple[A, B]last_x/last_Jx/last_errorinitialized toNonewithoutOptionalconstraint_counterpossibly-unbound (hoisted the= 0out of theverbosebranch)ns_vesseltypedlist[DQ]but acceptsNone→list[DQ] | Noneget_last_robot_pose()returnsDQ | Nonefrom aDQreturn typeexample*.pyandsaul/insertion_1.py: module/function docstrings + annotations (examples are excluded from the pyright check viaexcludeinpyproject.toml).marinholab/working/needlemanipulation/_core.pyi: fixed the self-referentialActuationTypetype alias.C++ (Doxygen
@file/@brief/@param/@return/@throws)include/M3_SerialManipulatorSimulatorFriendly.hsrc/M3_SerialManipulatorSimulatorFriendly.cpp(protected helpers_get_w,_joint_transformation+ file header)Type infrastructure
stubs/dqrobotics/: closed-set.pyistubs (__init__,robot_modeling,utils,solvers) for the untyped compileddqroboticspackage, declaring only the symbols this project imports. This is what lets the rest of the codebase be checked without globally weakening the checks. Wired up viastubPath = "stubs"inpyproject.toml.stubs/is intentionally not packaged:[tool.setuptools.packages.find] include = ["marinholab*"]keeps it out of the wheel.Documentation
AGENTS.md: new sections for the pyright/stubs workflow and the annotation + Doxygen conventions; fixed stale references to thetests/suite and the CI test job (both removed in Bring needle constraint work from simulator_tests (keep main's CI and core) #9).Verification
pyright1.1.411 (standard mode): 0 errors, 0 warnings, 0 informations (7 files analyzed).ast.parseon every touched Python file: OK.origin/main(docstrings/comments/annotations stripped): identical forsaul/insertion_1.pyand_impl.py; for the two controllers, the only deltas are annotations and 3 defensive guards that cannot fire in normal operation (alast_x/last_Jx is Nonecheck right after it is set, a redundantw is not NonealongsideW is not None, and abool()coercion ofkwargs["verbose"])._corefrom the new sources and reinstalled: build OK.NeedleController._get_optimization_parametersreturns finiteH (9,9),f (9,),W (19–20, 9);get_last_robot_pose()→DQ; all 11_implconstraint functions present and callable, including withns_vessel=None.This PR was created by an AI agent (OpenHands) on behalf of the user.