本文整理汇总了Python中species.Species.isIsomorphic方法的典型用法代码示例。如果您正苦于以下问题:Python Species.isIsomorphic方法的具体用法?Python Species.isIsomorphic怎么用?Python Species.isIsomorphic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类species.Species
的用法示例。
在下文中一共展示了Species.isIsomorphic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadChemkinFile
# 需要导入模块: from species import Species [as 别名]
# 或者: from species.Species import isIsomorphic [as 别名]
#.........这里部分代码省略.........
while line != '':
line = removeCommentFromLine(line)[0]
line = line.strip()
tokens = line.split()
if 'SPECIES' in line:
# List of species identifiers
index = tokens.index('SPECIES')
tokens = tokens[index+1:]
while 'END' not in tokens:
line = f.readline()
line = removeCommentFromLine(line)[0]
line = line.strip()
tokens.extend(line.split())
for token in tokens:
if token == 'END':
break
if token in speciesDict:
species = speciesDict[token]
else:
species = Species(label=token)
speciesDict[token] = species
speciesList.append(species)
# Also always add in a few bath gases (since RMG-Java does)
for label, smiles in [('Ar','[Ar]'), ('He','[He]'), ('Ne','[Ne]'), ('N2','N#N')]:
molecule = Molecule().fromSMILES(smiles)
for species in speciesList:
if species.label == label:
if len(species.molecule) == 0:
species.molecule = [molecule]
break
if species.isIsomorphic(molecule):
break
else:
species = Species(label=label, molecule=[molecule])
speciesList.append(species)
speciesDict[label] = species
elif 'THERM' in line:
# List of thermodynamics (hopefully one per species!)
line = f.readline()
thermo = ''
while line != '' and 'END' not in line:
line = removeCommentFromLine(line)[0]
if len(line) >= 80:
if line[79] in ['1', '2', '3', '4']:
thermo += line
if line[79] == '4':
label, thermo = readThermoEntry(thermo)
try:
speciesDict[label].thermo = thermo
except KeyError:
if label in ['Ar', 'N2', 'He', 'Ne']:
pass
else:
logging.warning('Skipping unexpected species "{0}" while reading thermodynamics entry.'.format(label))
thermo = ''
line = f.readline()
elif 'REACTIONS' in line:
# Reactions section
energyUnits = 'CAL/MOL'
moleculeUnits = 'MOLES'
try: