diff --git a/rmgpy/cantherm/input.py b/rmgpy/cantherm/input.py index 78cbf21339e..66151c9e4b8 100644 --- a/rmgpy/cantherm/input.py +++ b/rmgpy/cantherm/input.py @@ -130,6 +130,13 @@ def species(label, *args, **kwargs): if structure: spec.molecule = [structure] spec.conformer = Conformer(E0=E0, modes=modes, spinMultiplicity=spinMultiplicity, opticalIsomers=opticalIsomers) + if molecularWeight is None: + if spec.conformer.number is None: + raise ValueError('No molecularWeight entered for species {0}, and it cannot be reconstructed from' + ' conformer.number'.format(spec.label)) + else: + molecularWeight = Quantity(sum([getElement(int(element)).mass + for element in spec.conformer.number.value_si]), 'kg/mol') spec.molecularWeight = molecularWeight spec.transportData = collisionModel spec.energyTransferModel = energyTransferModel