Skip to content

fix: don't pass a positional argument to pgraph.UGraph - #127

Merged
petercorke merged 1 commit into
mainfrom
fix/pgraph-1.0-ugraph-dim
Oct 13, 2026
Merged

petercorke merged 1 commit into
mainfrom
fix/pgraph-1.0-ugraph-dim

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

  • `BundleAdjust` built its graph with `pgraph.UGraph(6)`. pgraph 1.0 makes constructor arguments keyword-only, so this raises `TypeError` there.
  • pgraph 0.6.5 accepted the `6` and silently ignored it, so the "6D coordinates" the comment describes were never enforced. They couldn't be: view vertices are 6D and landmark vertices are 3D (`dim=6` would reject every landmark).
  • Use `pgraph.UGraph()` and fix the comment. Behaviour is identical on 0.6.5 and 1.0, so this can merge before or after pgraph 1.0 is released and needs no version pin.

Test plan

  • `tests/test_bundle_adjust.py` and `tests/test_bundleadjust.py` pass (4 tests) against the pgraph 1.0 development branch with keyword-only arguments

🤖 Generated with Claude Code

pgraph 1.0 makes the graph constructor arguments keyword-only, so
UGraph(6) raises TypeError.  0.6.5 accepted and ignored the 6, so the
"6D coordinates" constraint was never in force; and it could not be:
landmark vertices are 3D and view vertices 6D.  Construct the graph with
no argument, which behaves identically on 0.6.5 and 1.0, and correct the
comment.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
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.

@petercorke
petercorke merged commit f5590e0 into main Oct 13, 2026
36 of 37 checks passed
@petercorke
petercorke deleted the fix/pgraph-1.0-ugraph-dim branch October 13, 2026 00:48
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.

1 participant