Repository navigation
feat: SE2Metric, a weight on the angle of the SE2 metric - #58
Merged
Merged
Conversation
The built-in "SE2" metric added radians to metres with equal weight, and had no way to change it. SE2Metric(weight) is the same norm with the wrapped angle multiplied by a weight, the length that a radian is worth. "SE2" is SE2Metric() so existing results do not change. An instance is a metric or a heuristic, is pickled with its weight, and compares equal by weight. Unlike the function it replaces it does not write into its argument. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 6 critical |
🟢 Metrics 27 complexity · 0 duplication
Metric Results Complexity 27 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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
+ Coverage 96.61% 96.71% +0.10%
==========================================
Files 3 3
Lines 1358 1371 +13
==========================================
+ Hits 1312 1326 +14
+ Misses 46 45 -1 ☔ 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.
The built-in
"SE2"metric adds radians to metres with equal weight, and there is no way to change that: in a test 144 of 300 nearest-vertex answers differed between a weight of 1 and 0.1.SE2Metric(weight)is the same norm with the wrapped angle multiplied by a weight, the length that a radian is worth:"SE2"isSE2Metric()(weight 1), so existing results are unchanged.closest,Vertex.distanceand the A* heuristic all go throughg.metric/g.heuristic, so they use the weight with no other change. A weighted L2 on a circle is still a metric, so it is a consistent heuristic when costs come from the metric;SE2Metric(weight=0)(planar distance) is the safe heuristic when costs come from elsewhere.SE2Metricis exported frompgraph._SE2assignedv[2]).Docs: a "Distance metrics" section in
construction.rstwith a worked example, themetric/heuristicdocstrings, and the intro.21 new tests, including A* against uniform-cost search at four weights. 625 pass, mypy clean, docs build with no warnings.
This is the first of two PRs; the second (spatial queries, a k-d tree for
closest/near) needs the weight.🤖 Generated with Claude Code