Separate transport data from comments in parseTransportData
This commit is contained in:
parent
3f382e2590
commit
d1df40af87
2 changed files with 7 additions and 5 deletions
|
|
@ -1933,21 +1933,23 @@ class Parser(object):
|
||||||
|
|
||||||
if '!' in line:
|
if '!' in line:
|
||||||
line, comment = line.split('!', 1)
|
line, comment = line.split('!', 1)
|
||||||
data = line.split() + [comment]
|
|
||||||
else:
|
else:
|
||||||
data = line.split()
|
comment = None
|
||||||
|
|
||||||
|
data = line.split()
|
||||||
|
|
||||||
if len(data) < 7:
|
if len(data) < 7:
|
||||||
raise InputParseError('Unable to parse transport data: not'
|
raise InputParseError('Unable to parse transport data: not'
|
||||||
' enough parameters on line {0} of "{1}".'.format(
|
' enough parameters on line {0} of "{1}".'.format(
|
||||||
line_offset + i, filename))
|
line_offset + i, filename))
|
||||||
if len(data) > 8:
|
if len(data) > 7:
|
||||||
raise InputParseError('Extra parameters found in transport entry'
|
raise InputParseError('Extra parameters found in transport entry'
|
||||||
' for species {0} in file {1}'.format(data[0], filename))
|
' for species {0} in file {1}'.format(data[0], filename))
|
||||||
|
|
||||||
speciesName = data[0]
|
speciesName = data[0]
|
||||||
if speciesName in self.speciesDict:
|
if speciesName in self.speciesDict:
|
||||||
if self.speciesDict[speciesName].transport is None:
|
if self.speciesDict[speciesName].transport is None:
|
||||||
self.speciesDict[speciesName].transport = TransportData(*data)
|
self.speciesDict[speciesName].transport = TransportData(*data, comment=comment)
|
||||||
else:
|
else:
|
||||||
self.warn('Ignoring duplicate transport data'
|
self.warn('Ignoring duplicate transport data'
|
||||||
' for species "{0} on line {1} of "{2}".'.format(
|
' for species "{0} on line {1} of "{2}".'.format(
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
AR 0 136.500 3.330 0.000 0.000 0.000
|
AR 0 136.500 3.330 0.000 0.000 0.000
|
||||||
H 0 145.000 2.050 0.000 0.000 0.000
|
H 0 145.000 2.050 0.000 0.000 0.000
|
||||||
H2 1 38.000 2.920 0.000 0.790 280.000
|
H2 1 38.000 2.920 0.000 0.790 280.000
|
||||||
H2O 2 572.400 2.605 1.8 0. 0.000 4.000 ! bad entry
|
H2O 2 572.400 2.605 1.8 0. 0.000 4.000
|
||||||
H2O2 2 107.400 3.458 0.000 0.000 3.800
|
H2O2 2 107.400 3.458 0.000 0.000 3.800
|
||||||
HO2 2 107.400 3.458 0.000 0.000 1.000 ! *
|
HO2 2 107.400 3.458 0.000 0.000 1.000 ! *
|
||||||
O 0 80.000 2.750 0.000 0.000 0.000
|
O 0 80.000 2.750 0.000 0.000 0.000
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue