Skip to content

Commit 6c8976f

Browse files
mliu49mjohnson541
authored andcommitted
Replace misc print statements with logging or exceptions
1 parent 7595b6a commit 6c8976f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

rmgpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __setitem__(self, key, value):
6565
elif key == 'test_data.directory':
6666
value = os.path.abspath(os.path.expandvars(value))
6767
else:
68-
print('Unexpecting setting "{0}" encountered.'.format(key))
68+
raise SettingsError('Unexpecting setting "{0}" encountered.'.format(key))
6969
self.sources[key] = '-'
7070
super(Settings, self).__setitem__(key, value)
7171

rmgpy/cantherm/gaussian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def loadGeometry(self):
157157
elif number[i] == 17:
158158
mass[i] = 35.4527
159159
else:
160-
print 'Atomic number {0:d} not yet supported in loadGeometry().'.format(number[i])
160+
raise NotImplementedError('Atomic number {0:d} not yet supported in loadGeometry().'.format(number[i]))
161161

162162
return coord, number, mass
163163

rmgpy/cantherm/qchem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def loadGeometry(self):
175175
mass[i] = 35.4527
176176
number.append('17')
177177
else:
178-
print 'Atomic atom {0:d} not yet supported in loadGeometry().'.format(atom[i])
178+
raise NotImplementedError('Atomic atom {0:d} not yet supported in loadGeometry().'.format(atom[i]))
179179
number = numpy.array(number, numpy.int)
180180
return coord, number, mass
181181

rmgpy/data/kinetics/family.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ def generateProductTemplate(self, reactants0):
944944
try:
945945
if s.isIdentical(struct): break
946946
except KeyError:
947-
print struct.toAdjacencyList()
948-
print s.toAdjacencyList()
947+
logging.error(struct.toAdjacencyList())
948+
logging.error(s.toAdjacencyList())
949949
raise
950950
else:
951951
productStructureList[i].append(struct)

rmgpy/species.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ def toCantera(self, useChemkinIdentifier = False):
274274
if self.thermo:
275275
try:
276276
ctSpecies.thermo = self.thermo.toCantera()
277-
except Exception, e:
278-
print e
279-
raise Exception('Could not convert thermo to create Cantera Species object. Check that thermo is a NASA polynomial.')
277+
except Exception:
278+
logging.error('Could not convert thermo to create Cantera Species object. Check that thermo is a NASA polynomial.')
279+
raise
280280

281281
if self.transportData:
282282
ctSpecies.transport = self.transportData.toCantera()

0 commit comments

Comments
 (0)