Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bonds #16

Open
pstjohn opened this issue Nov 24, 2023 · 2 comments
Open

Add bonds #16

pstjohn opened this issue Nov 24, 2023 · 2 comments

Comments

@pstjohn
Copy link

pstjohn commented Nov 24, 2023

It would be great to have access to bond-level information: https://www.rdkit.org/docs/cppapi/classRDKit_1_1Bond.html
along with associated methods in molecule structures that get bonds.

Would that be as simple as adding the necessary items to ro_mol.rs?

Related, did you look into autocxx to help build out some of the boilerplate wrapper code?

@xrl
Copy link
Contributor

xrl commented Nov 24, 2023

@pstjohn unfortunately I did not get autocxx working. I would love to get away from manually setting up bindings for every little thing -- it's terribly error prone and for the most part I'm just smart enough to be dangerous on C++ vs Rust.

I did start this issue: google/autocxx#1334 . I'd gladly accept help on using autocxx, manually setting up bindings isn't a great use of anyone's time.

@xrl
Copy link
Contributor

xrl commented Nov 24, 2023

To your original point, yes, it sounds like you'll want to expose something like bonds(ptr: SharedPtr<ROMol> -> CxxVector<Bond> and introduce a type Bond in ro_mol.rs. Unfortunately I never figured out how to expose a CXX iter in Rust, so I instead just drain the iterator in to a vector and return the vector -- but passing around vectors with complex interior types is a bit of a game in cxx.

Getting autocxx working might be more efficient.

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

No branches or pull requests

2 participants