Skip to content

Commit 55f8fc4

Browse files
committed
Change debug level of RDKit-related warnings
Some compounds with resonance form resonance hybrids, which create non-integer bond orders that then call ring perception (via get_symmetry_number). Because non-integer bond orders are not recognized, we handle them as `unspecified`. Alternatively, the kekulization rules for RMG may sometimes differ from those of RDKit, which also logged a warning. For ring perception, these 'warnings' do not impact performance, and for nearly all users should not raise any concerns. So this demotes the logging level from `warning` to `debug`
1 parent 2e9ba69 commit 55f8fc4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rmgpy/molecule/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def to_rdkit_mol(mol, remove_h=True, return_mapping=False, sanitize=True, save_o
132132
try:
133133
Chem.SanitizeMol(rdkitmol, sanitizeOps=Chem.SANITIZE_ALL ^ Chem.SANITIZE_PROPERTIES)
134134
except (KekulizeException, AtomKekulizeException):
135-
logging.warning("Kekulization failed; sanitizing without Kekulize")
135+
logging.debug("Kekulization failed; sanitizing without Kekulize")
136136
Chem.SanitizeMol(rdkitmol, sanitizeOps=Chem.SANITIZE_ALL ^ Chem.SANITIZE_PROPERTIES ^ Chem.SANITIZE_KEKULIZE)
137137
if remove_h:
138138
rdkitmol = Chem.RemoveHs(rdkitmol, sanitize=sanitize)

rmgpy/molecule/molecule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def get_order_str(self):
787787
elif self.is_reaction_bond():
788788
return 'R'
789789
else:
790-
logging.warning("Bond order {} does not have string representation.".format(self.order))
790+
logging.debug("Bond order {} does not have string representation; treating as unspecified.".format(self.order))
791791
return None
792792

793793
def set_order_str(self, new_order):

0 commit comments

Comments
 (0)