Skip to content

Commit 2605f8f

Browse files
committed
Molecule: new method has_bond
1 parent 1a9a8cf commit 2605f8f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,12 @@ impl PyMolecule {
861861
self.inner.remove_bond(i, j);
862862
}
863863

864+
/// Returns true if the molcule contains bond between atom `i` and `j`
865+
#[pyo3(text_signature = "($self, i, j, /)")]
866+
pub fn has_bond(&self, i: usize, j: usize) -> bool {
867+
self.inner.has_bond(i, j)
868+
}
869+
864870
/// Return all directly bonded atoms in serial numbers with atom `n`.
865871
#[pyo3(text_signature = "($self, n)")]
866872
pub fn connected(&self, n: usize) -> Vec<usize> {

0 commit comments

Comments
 (0)