Skip to content

Commit 2571933

Browse files
committed
Get it to work (mostly) with older versions of rdkit
Travis build would be faster if we could use the Ubuntu RPM version of rdkit, but unfortunately that is old and doesn't know about the element Dubnium. This hacky work-around solves it. Helpful for people wanting to use Ubuntu, without QM. (QM features require RDKit to be built with InChI support, which means you have to build it from source anyway)
1 parent 1400e67 commit 2571933

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

rmgpy/molecule/element.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ def __init__(self, number, symbol, name, mass):
7878
self.symbol = intern(symbol)
7979
self.name = name
8080
self.mass = mass
81-
self.covRadius = _rdkit_periodic_table.GetRcovalent(symbol)
81+
try:
82+
self.covRadius = _rdkit_periodic_table.GetRcovalent(symbol)
83+
except RuntimeError:
84+
import logging
85+
logging.error("RDkit doesn't know element {0} so covalent radius unknown".format(symbol))
86+
self.covRadius = 0
8287

8388
def __str__(self):
8489
"""

0 commit comments

Comments
 (0)