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

Boost.Python.ArgumentError in SetFormalCharge function #1

Closed
qjornet opened this issue Jun 26, 2018 · 3 comments
Closed

Boost.Python.ArgumentError in SetFormalCharge function #1

qjornet opened this issue Jun 26, 2018 · 3 comments

Comments

@qjornet
Copy link

qjornet commented Jun 26, 2018

Dear Developer,

My name is Joaquim Jornet-Somoza (quim), postdoctoral researcher on theoretical and computational chemistry.
I have a set of xyz files (in fact, one file with concatenated xyz blocks), that I would like to pass to RD-Kit as mol.
I looked to your code and I found it interesting for my purpose.
Howevere, when I tryed the test examples it fails for the acetate xyz file (not for the ethane.xyz) saying:

$python xyz2mol.py acetate.xyz
Traceback (most recent call last):
File "xyz2mol.py", line 362, in
mol = xyz2mol(atomicNumList,charge,xyz_coordinates,charged_fragments)
File "xyz2mol.py", line 346, in xyz2mol
new_mol = AC2mol(mol,AC,atomicNumList,charge,charged_fragments)
File "xyz2mol.py", line 251, in AC2mol
mol = BO2mol(mol,BO, atomicNumList,atomic_valence_electrons,charge,charged_fragments)
File "xyz2mol.py", line 141, in BO2mol
mol = set_atomic_charges(mol,atomicNumList,atomic_valence_electrons,BO_valences,BO_matrix,mol_charge)
File "xyz2mol.py", line 163, in set_atomic_charges
a.SetFormalCharge(charge)
Boost.Python.ArgumentError: Python argument types in
Atom.SetFormalCharge(Atom, numpy.int64)
did not match C++ signature:
SetFormalCharge(RDKit::Atom {lvalue}, int)

Could you tell me where does this errors come from ?
Sincerely
quim

@jhjensen2
Copy link
Member

jhjensen2 commented Jun 26, 2018

I can't reproduce this using my version of the code.

What version of RDKit are you using? I am using 2016.09.2
You can find out by

from rdkit import rdBase
print(rdBase.rdkitVersion)

Also, are you using Python 3? I've only tested this for Python 2.7.

@qjornet
Copy link
Author

qjornet commented Jun 27, 2018

I am using Python 3, with RDKit version 2017.03.1.
I have modified the your printing calls to the Python 3 compatible form , i.e. print().

@jhjensen2
Copy link
Member

Ah, OK. It's fixed now.

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