fix: drop stale ax= kwarg from ArmPlot's robot.plot() call - #590
Open
petercorke wants to merge 1 commit into
Open
fix: drop stale ax= kwarg from ArmPlot's robot.plot() call#590petercorke wants to merge 1 commit into
petercorke wants to merge 1 commit into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
BaseRobot.plot()no longer accepts anax=parameter — onlyfig=isreal and documented;
axisn't referenced anywhere in its body, andflows straight through into
env.add(), whose signature (PyPlot.add())has never accepted
axeither.roboticstoolbox/blocks/arm.py'sArmPlot.start()assertsself.ax is not Noneand then passesax=self.axintorobot.plot(),raising:
self.axisn't used anywhere else inarm.py— dropping it from thisone call site is sufficient;
robot.plot()manages its own axesinternally 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 thenotebook side, not an RTB issue).
Test plan
tests/test_blocks.py: 22 passed, 6 skipped, no failures (none ofthese previously exercised this exact
ArmPlot.start()code path,which is how this went unnoticed)
RVC3/models/RRMC.py(a bdsimblock-diagram simulation using
ARMPLOT) now runs end-to-end andproduces the expected
out.clock0.t/.xresults, where itpreviously crashed at
plot.start