jensengroup / xyz2mol

Converts an xyz file to an RDKit mol object
MIT License
250 stars 70 forks source link

Add UserWarning for incorrect charge? #32

Closed RMeli closed 1 year ago

RMeli commented 2 years ago

If the following check fails https://github.com/jensengroup/xyz2mol/blob/f51267357b250855007fd628446b3fbbed715ff2/xyz2mol.py#L507-L509 an empty list is returned by AC2mol and therefore xyz2mol.py terminates without any output whatsoever.

I suggest to add an UserWarning in case this check fails, which prints out both Chem.GetFormalCharge(mol) and charge, to indicate what is happening to the user.

I can open a PR from the code on my fork, unless you prefer to keep the current "silent mode".