Skip to content

Add bonds #16

Open
Open

Description

@pstjohn

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?

Activity

  1. xrl commented on Nov 24, 2023

    @xrl
    Contributor

    @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.

  2. xrl commented on Nov 24, 2023

    @xrl
    Contributor

    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.

  3. xrl commented on Oct 9, 2026

    @xrl
    Contributor

    #57 adds molecule-borrowed bond views, bond iteration/endpoints/type/stereo/direction getters, and checked basic graph editing. The ownership design also covers immutable atom views and exclusive mutation. Keeping this request open while that draft is reviewed; additional mutable bond/stereo controls from #51 remain useful follow-up work.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions