Skip to content

fix: drop stale ax= kwarg from ArmPlot's robot.plot() call - #590

Open
petercorke wants to merge 1 commit into
mainfrom
fix/armplot-stale-ax-kwarg
Open

fix: drop stale ax= kwarg from ArmPlot's robot.plot() call#590
petercorke wants to merge 1 commit into
mainfrom
fix/armplot-stale-ax-kwarg

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

BaseRobot.plot() no longer accepts an ax= parameter — only fig= is
real and documented; ax isn't referenced anywhere in its body, and
flows straight through into env.add(), whose signature (PyPlot.add())
has never accepted ax either.

roboticstoolbox/blocks/arm.py's ArmPlot.start() asserts
self.ax is not None and then passes ax=self.ax into robot.plot(),
raising:

TypeError: PyPlot.add() got an unexpected keyword argument 'ax'

self.ax isn't used anywhere else in arm.py — dropping it from this
one call site is sufficient; robot.plot() manages its own axes
internally given fig=.

Found while investigating a bdsim block-diagram example (from
RVC3-python, the RVC book's companion repo) that used to work in 2022 —
this was the second of two stacked bugs blocking it end-to-end, the first
being bdsim's own PROD(matrix=True) removal (unrelated, fixed on the
notebook side, not an RTB issue).

Test plan

  • tests/test_blocks.py: 22 passed, 6 skipped, no failures (none of
    these previously exercised this exact ArmPlot.start() code path,
    which is how this went unnoticed)
  • Real reproduction: RVC3-python's RVC3/models/RRMC.py (a bdsim
    block-diagram simulation using ARMPLOT) now runs end-to-end and
    produces the expected out.clock0.t/.x results, where it
    previously crashed at plot.start

BaseRobot.plot() no longer accepts an ax= parameter -- only fig= is a
real, documented parameter; ax isn't referenced anywhere in its body or
docstring, and flows straight through into env.add(), whose signature
(PyPlot.add()) has never accepted ax either. Found via bdsim's ARMPLOT
block, which asserts self.ax is not None and then passes ax=self.ax
into robot.plot(), raising TypeError: PyPlot.add() got an unexpected
keyword argument 'ax'.

self.ax isn't used anywhere else in arm.py -- dropping it from this one
call site is sufficient, robot.plot() manages its own axes internally
given fig=.

Found while investigating a bdsim example (RVC3-python's RRMC.py) that
used to work in the book (2022) -- this was the second of two stacked
bugs blocking it end to end, the first being bdsim's own PROD(matrix=)
removal (unrelated, fixed on the notebook side).
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (fc44c37) to head (b499a19).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #590   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        142     142           
  Lines      13827   13882   +55     
=====================================
- Misses     13827   13882   +55     

☔ 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.

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