Repository navigation
refactor: apply the format string once in plot_aligned_box, plot_MEC and plot_MER - #271
Merged
Merged
Conversation
…and plot_MER The string was folded into the options by mpl_styling and also passed to spatialmath as *args, so it was parsed twice. The output is the same for every string tried; pin it with a test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 14 |
| Duplication | 0 |
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.
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.
Blobs.plot_aligned_box,plot_MECandplot_MERread their format string twice:mpl_stylingfolded it intooptions, and the same string was also passed to spatialmath'splot_polygonorplot_circleas*args, whereplt.plotparsed it again. Sincempl_stylingnow follows the same rules asplot(PR 267, merged), the second pass adds nothing. This removes it, so each string is read in one place.No change in behavior. I drew each of the three methods with 12 strings (none,
"g","r--","--","r:","o","r.","k-.","C1","orange","bs","+") before and after the change, and compared the color, line style, marker, line width and line count of what was drawn: all 36 cases are identical. A new test pins nine of them for each method ("o"is markers only,"--"keeps the default yellow), so the two ways of reading the string cannot drift apart again.Found while looking at
plot_labelbox(PR 270, open), which had the same double pass and a bug from it. The otherBlobs.plot_*methods pass the string once.mypy reports no issues and the full suite passes (2261 passed, 33 skipped).
AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code