Repository navigation
fix(backends): PyPlot backend fixes, Connector as a Protocol, one window-title helper - #788
Merged
Merged
Conversation
…aunch, PyPlot2 window title ShapePlot.plot used an undefined name and always raised NameError. EllipsePlot with an etype other than 'v' or 'f' failed later with an AttributeError. PyPlot.__repr__ read sim_time before launch set it. PyPlot2.launch assumed a figure manager with set_window_title, which a headless backend does not have. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… ShapePlot and EllipsePlot use axes_logic Swift does not depend on RTB and so cannot inherit from Connector, though load_backend returns it as one. A Protocol states what RTB needs of a backend, and the PyPlot backends inherit it for the defaults. The teach pendant's ellipsoids are set with setattr, they are not part of the interface. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ends and Vehicle Vehicle reached into canvas.manager itself; MVTB has its own with a bare except. The helper does nothing for a figure without a window. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
SMTB PR #263. The copy stays until the minimum Spatial Math version has it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
| Security | 1 critical |
🟢 Metrics 23 complexity · 2 duplication
Metric Results Complexity 23 Duplication 2
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.
…f the same name Python 3.10 mock resolves roboticstoolbox.backends.PyPlot.PyPlot to the class. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #788 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 144 144
Lines 14871 14853 -18
=====================================
+ Misses 14871 14853 -18 ☔ 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
Fixes in the PyPlot backends (problems 44 to 48 of the typing pass) and a truthful type for what a backend is.
Fixes
ShapePlot.plotused an undefined name (ax) and always raisedNameError. Its axes now come fromaxes_logic, soax=means "draw into this axes" andNonereuses the current 3D axes or makes one, as elsewhere in RTB.EllipsePlotwith anetypeother than'v'or'f'failed later withAttributeError; it raisesValueErrorat construction. The defaultcentreis a tuple, not a shared list.PyPlot.__repr__readsim_timebeforelaunchset it; it is set in__init__.PyPlot2.launchassumed a figure manager withset_window_title, which a headless backend does not have.Connectoris aProtocol. Swift does not depend on RTB and cannot inherit fromConnector, yetload_backendreturned it as one. The Protocol states what RTB needs of a backend (launch,step,reset,restart,close,add,remove,holdand thesupports_teachandsupports_ellipseflags).PyPlot,PyPlot2andROSinherit it explicitly, which gives them the defaults and keeps a missing method an error at construction. The teach pendant's ellipsoids are set withsetattrrather than being part of the interface.One
set_window_title(fig, title)inroboticstoolbox.tools.plot, used byPyPlot,PyPlot2andVehicle(which reached intocanvas.manageritself). It does nothing for a figure without a window. It usesspatialmath.base.set_window_titleonce that exists (SMTB PR rai-opensource/spatialmath-python#263), and the local copy goes then.Not changed
Test plan
tests/test_pyplot_backend_fixes.py🤖 Generated with Claude Code