Skip to content

Generate pybind declarations before bindings - #205

Merged
ProfFan merged 1 commit into
masterfrom
feature/module_decl
Aug 23, 2026
Merged

Generate pybind declarations before bindings#205
ProfFan merged 1 commit into
masterfrom
feature/module_decl

Conversation

@ProfFan

@ProfFan ProfFan commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Split generated pybind code into declaration and binding phases.
  • Register every class, enum, namespace, and container before binding any callable signatures.
  • Recover registered Python objects during the binding phase to add constructors, methods, properties, and functions.
  • Update the custom-template contract, documentation, golden outputs, and regression coverage.

Motivation

pybind11 constructs callable signatures when bindings are created. If a referenced wrapped type is declared by a later interface file, the signature can retain a raw C++ type name. Module-wide declare-then-bind ordering ensures all wrapped types are registered first.

Addresses borglab/gtsam#1824.

Validation

  • Wrap CI sequence: 130 passed, 86% coverage.
  • GTSAM stable and unstable Python extensions regenerated, compiled, and linked successfully using this branch.
  • GTSAM stable Python suite: 510 passed, 6 skipped, 11 subtests passed.
  • GTSAM current unstable Python suite: 6 passed, 6 subtests passed.

@ProfFan
ProfFan requested a review from dellaert August 23, 2026 23:07

@dellaert dellaert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you test it with GTSAM locally? I’d not merge until that works :-)

@ProfFan

ProfFan commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator Author

Yes

@ProfFan
ProfFan merged commit 47d56b2 into master Aug 23, 2026
8 checks passed
@ProfFan
ProfFan deleted the feature/module_decl branch August 23, 2026 23:40
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.

2 participants