Repository navigation
fix: a figure with no window manager no longer raises when graphics blocks set the window title - #266
Conversation
…locks set the window title graphics_block set the title with f.canvas.manager.set_window_title(...) in two places. A figure on a backend that has no window manager has canvas.manager None, so that raised AttributeError. Use spatialmath.base.set_window_title, which does nothing and returns False for such a figure (spatialmath-python 1.1.19, already the minimum version). The test fails without the change. Closes #114 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage
Metric Results Coverage variation Report missing for f7058b31 Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (f7058b3) Report Missing Report Missing Report Missing Head commit (1681558) 6121 5133 83.86% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#266) 3 3 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
=======================================
Coverage 83.85% 83.85%
=======================================
Files 26 26
Lines 6120 6121 +1
=======================================
+ Hits 5132 5133 +1
Misses 988 988 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #114.
graphics_block.pyset the figure's window title withf.canvas.manager.set_window_title(...)in two places (the first figure, and later untiled ones). On a backend with no window manager,canvas.managerisNone, so that raisedAttributeError. It now callsspatialmath.base.set_window_title(fig, title), which does nothing and returnsFalsefor such a figure. That function is in spatialmath-python 1.1.19 (rai-opensource/spatialmath-python#263), which is already bdsim's minimum version, so there is no dependency change.Tested
test_create_figure_without_window_managermakes pyplot figures whosecanvas.managerisNoneand callscreate_figure()for the first and a later figure. It fails without the change ('NoneType' object has no attribute 'set_window_title') and passes with it.bdeditprint tests, which need thebdeditextra's Qt packages that venv lacks.Note for contributors with an editable spatialmath-python checkout: it needs to be at 1.1.19 or later, or
import bdsimfails on the new import.🤖 Generated with Claude Code