Skip to content

chore(typing): annotate the tools, models, demo, ets and robot packages - #768

Merged
petercorke merged 4 commits into
mainfrom
typing/robot
Oct 14, 2026
Merged

petercorke merged 4 commits into
mainfrom
typing/robot

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Next steps of the type hinting pass, one commit per area: tools, demo/bin/models, ets, robot.

  • Every function in these packages is annotated and the modules are held to disallow_untyped_defs, apart from the ones left on the mypy to-do list: tools/trajectory.py (the open fix(trajectory): normalize quintic profile time #736), mobile/ParticleFilter.py (the open fix(mobile): use circular particle heading moments #735), the two unused DHFactor modules and a stale test file inside tools/urdf/tests.
  • BaseETS is now generic over its element type (BaseETS[ET] for ETS, BaseETS[ET2] for ETS2), which replaces the overloads on self that mypy rejects as invalid. ets[i] is an ET, ets[a:b] an ETS.
  • 68 # type: ignore comments left over from the pyright pass were unused and are removed.
  • Where the same name is both a module and a class (roboticstoolbox.ets.ETS, robot.Link) the imports are explicit.
  • Behaviour unchanged except on paths that already raised (EKF.map-style attribute typos, isinstance(camera, "Robot"), np.infty removed in NumPy 2, Connector._add_teach_panel missing). The real bugs found are left for the end of the pass.

mypy clean on the whole package, 923 tests pass locally (the 19 that need the compiled extensions fail in a source worktree as they do on main).

🤖 Generated with Claude Code

petercorke and others added 4 commits October 14, 2026 20:32
DHFactor and trajectory stay on the to-do list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The five ETS models that depend on the typing of the ets package stay on
the to-do list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
BaseETS is generic over its element type, replacing the overloads on self.
The five ETS models that depended on it come off the to-do list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DHFactor stays on the to-do list: it is not used anywhere.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 74 high

Alerts:
⚠ 74 issues (≤ 0 issues of at least minor severity)

Results:
74 new issues

Category Results
ErrorProne 73 high
Security 1 high

View in Codacy

🟢 Metrics 0 complexity · 7 duplication

Metric Results
Complexity 0
Duplication 7

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 888 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (b83b469) to head (5f715d6).

Files with missing lines Patch % Lines
src/roboticstoolbox/tools/urdf/urdf.py 0.00% 131 Missing ⚠️
src/roboticstoolbox/robot/BaseRobot.py 0.00% 61 Missing ⚠️
src/roboticstoolbox/robot/DHRobot.py 0.00% 60 Missing ⚠️
src/roboticstoolbox/robot/Link.py 0.00% 55 Missing ⚠️
src/roboticstoolbox/ets/_ETS.py 0.00% 49 Missing ⚠️
src/roboticstoolbox/robot/Robot.py 0.00% 37 Missing ⚠️
src/roboticstoolbox/robot/DHLink.py 0.00% 32 Missing ⚠️
src/roboticstoolbox/robot/IK.py 0.00% 30 Missing ⚠️
src/roboticstoolbox/ets/fknm.py 0.00% 26 Missing ⚠️
src/roboticstoolbox/robot/PoERobot.py 0.00% 26 Missing ⚠️
... and 84 more
Additional details and impacted files
@@          Coverage Diff           @@
##            main    #768    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files        143     143            
  Lines      14594   14785   +191     
======================================
- Misses     14594   14785   +191     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit 2de1e3e into main Oct 14, 2026
25 of 26 checks passed
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.

1 participant