Repository navigation
fix(mobile): maps: stricter arguments, clearer names, docstrings and types - #779
Merged
Merged
Conversation
… and types OccGrid.py - BaseMap and the grids no longer swallow unknown keyword arguments, so BinaryOccupancyGrid(g, size=0.1) is a TypeError (the argument is cellsize) - a grid with neither an array nor a workspace is a ValueError, not an AttributeError later - dx/dy become width/height properties; w2g/g2w/line_w become world_to_grid/grid_to_world/line_world, the short names kept as aliases - PolygonMap.iscollision accepts the ndarray its docstring said it did - set() documents the region order it actually uses, [xmin, xmax, ymin, ymax] - types ArrayLike2/ArrayLike4/R2/R4; typos; stale __main__ demo and lgtm comments removed; missing docstrings landmarkmap.py - plot() merges any options over LANDMARK_STYLE; any keyword used to drop the whole default style - an integer count may be a NumPy integer - first argument is landmarks (map deprecated), verbose deprecated (no effect) - MATLAB-style comment replaced by a docstring; reference updated Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 2 high |
🟢 Metrics 17 complexity · 2 duplication
Metric Results Complexity 17 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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #779 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 144 144
Lines 14712 14729 +17
=====================================
- Misses 14712 14729 +17 ☔ 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.
What
The map classes (
OccGrid.py,landmarkmap.py): entries 15-17 of the typing-pass problem list and what a review of the two files turned up. Builds on the workspace resolver (#776).Fixed
BaseMapand the occupancy grids swallowed unknown keyword arguments, soBinaryOccupancyGrid(g, size=0.1)was accepted and ignored (the argument iscellsize). It is now aTypeError.AttributeError; it is aValueErrorat construction (entry 16).PolygonMap.iscollisionis documented to accept anndarraybut crashed on one; it now wraps it in aPolygon2.LandmarkMap.plotdropped its whole default style as soon as any keyword was given; options are now merged overLANDMARK_STYLE.set()documented the region as[xmin, ymin, xmax, ymax]; the code (and now the docstring) use[xmin, xmax, ymin, ymax], as for a workspace.Renamed (old names still work)
dx,dyare replaced bywidth,heightproperties.w2g,g2w,line_wbecomeworld_to_grid,grid_to_world,line_world; the short names are kept as plain aliases (used inPoseGraph.py).LandmarkMap(map=...)becomesLandmarkMap(landmarks=...);map=is a deprecated keyword. The first positional argument is unchanged.LandmarkMap(verbose=...)had no effect and is deprecated.Not touched: negative-index wrap in
BinaryOccupancyGrid.isoccupied, which contributor PR #769 fixes.Docstrings and types
ArrayLike2,ArrayLike4,R2,R4,Points2; typos; missing docstrings added (PolygonMap.plot, the__str__and__repr__methods); stale__main__demos andlgtmcomments removed.Full suite 1077 passed (with both compiled extensions), mypy clean.
🤖 Generated with Claude Code