From ffd76edbb8f2f3995cdf53614bccb9e5f87c0e6c Mon Sep 17 00:00:00 2001 From: MarkGoldman Date: Wed, 21 Nov 2018 10:19:55 -0500 Subject: [PATCH] Allow hasStatMech to assess atomic molecules Previously, hasStatMech would return True for any molecule with one atom, even if the E0 parameter was None. This raises issues when creating pdep networks since E0 is necessary. At the same time, this method does not check E0 parameters even for polyatomic molecules. This commit reworks hasStatMech to differentiate between atomic molecules, which it only checks the E0 parameter, and polyatomic molecules, which it checks both E0 and the number of modes. --- rmgpy/species.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rmgpy/species.py b/rmgpy/species.py index 7db5212623..76e89e7f83 100644 --- a/rmgpy/species.py +++ b/rmgpy/species.py @@ -328,7 +328,12 @@ def hasStatMech(self): Return ``True`` if the species has statistical mechanical parameters, or ``False`` otherwise. """ - return self.conformer is not None and (len(self.conformer.modes) > 0 or (len(self.molecule) > 0 and len(self.molecule[0].atoms) == 1)) + if (len(self.molecule) > 0 and len(self.molecule[0].atoms) == 1): + #atomic molecules have no modes, check only E0 + return self.conformer is not None and self.conformer.E0 is not None + else: + #polyatomic molecules should have modes and E0, so check both + return self.conformer is not None and len(self.conformer.modes) > 0 and self.conformer.E0 is not None def hasThermo(self): """