Skip to content

fix(spatial): handle SE2 angles that round to the period - #86

Open
Vamsi-2581 wants to merge 2 commits into
petercorke:mainfrom
Vamsi-2581:codex/fix-se2-periodic-wrap-85
Open

Vamsi-2581 wants to merge 2 commits into
petercorke:mainfrom
Vamsi-2581:codex/fix-se2-periodic-wrap-85

Conversation

@Vamsi-2581

@Vamsi-2581 Vamsi-2581 commented Oct 23, 2026 •

Copy link
Copy Markdown

What

Normalize wrapped SE(2) angles that round to the period back to zero for both KD-tree data and query points. This prevents scipy.spatial.cKDTree from rejecting coordinates when a tiny negative angle wraps to the period due to floating-point rounding.

Tests

  • Added regression coverage for stored coordinates and query angles at -1e-17, using named SE(2) and a weighted SE(2) metric.
  • Tests were not run locally.
  • The latest GitHub Actions status shows two workflows awaiting maintainer approval; the required test check is still pending. CI has not validated this head yet.

Fixes #85.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 6 complexity · 0 duplication

Metric Results
Complexity 6
Duplication 0

View in Codacy

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.

@huxiaoyi-ovo huxiaoyi-ovo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked both the stored-angle and query-side wrapping against SciPy's periodic cKDTree, including the default SE2 metric and a weight of 0.3.

The boundary values now map correctly to zero, and both nearest-neighbour and radius queries return the expected vertex. Looks good from the code side.

CI is still waiting for maintainer approval, so that remains to be checked.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build_kdtree fails for an SE2 graph with a heading just below zero

2 participants