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

addBond return value #572

Closed
JLVarjo opened this issue Aug 21, 2015 · 1 comment
Closed

addBond return value #572

JLVarjo opened this issue Aug 21, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@JLVarjo
Copy link
Contributor

JLVarjo commented Aug 21, 2015

Hi,

according to docs, the function RWMol::addBond should return the index of a newly added bond.
In the function, the index of a new bond is set as follows:

unsigned int res = boost::num_edges(d_graph);
b->setIdx(res-1);

but then the function returns just "res", instead of "res-1". Bug, right?

Best,
Juuso Lehtivarjo

@greglandrum greglandrum added this to the 2015_09_1 milestone Aug 24, 2015
@greglandrum greglandrum self-assigned this Aug 24, 2015
@greglandrum
Copy link
Member

It's ok in the C++ documentation, which is clear that it returns the number of bonds:
https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/RWMol.h#L132

it is, however, a problem in the python wrapper: https://github.com/rdkit/rdkit/blob/master/Code/GraphMol/Wrap/Mol.cpp#L501

greglandrum added a commit to greglandrum/rdkit that referenced this issue Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants