本文整理汇总了Python中rmgpy.data.rmg.RMGDatabase.loadOld方法的典型用法代码示例。如果您正苦于以下问题:Python RMGDatabase.loadOld方法的具体用法?Python RMGDatabase.loadOld怎么用?Python RMGDatabase.loadOld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rmgpy.data.rmg.RMGDatabase
的用法示例。
在下文中一共展示了RMGDatabase.loadOld方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getUsername
# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import loadOld [as 别名]
for label, entry in library.entries.iteritems():
entry.history.append(event)
groups = database.states.groups
for label, entry in groups.entries.iteritems():
entry.history.append(event)
for label, entry in database.forbiddenStructures.entries.iteritems():
entry.history.append(event)
################################################################################
if __name__ == '__main__':
#figure out the username
user = getUsername()
# Set the import and export paths
oldPath = 'output/RMG_database'
newPath = 'input'
print 'Loading old RMG-Java database...'
database = RMGDatabase()
database.loadOld(oldPath)
print 'Setting history of all entries in database...'
setHistory(database, user=user)
print 'Saving the new RMG-Py database...'
database.save(newPath)
示例2: RMGDatabase
# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import loadOld [as 别名]
################################################################################
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('inputPath', metavar='INPUT', type=str, nargs=1,
help='the input path of the RMG-Java database directory')
parser.add_argument('outputPath', metavar='OUTPUT', type=str, nargs=1,
help='output path for the desired RMG-Py database directory')
args = parser.parse_args()
inputPath = args.inputPath[0]
outputPath = args.outputPath[0]
newPath = 'input'
print 'Loading old RMG-Java database...'
database = RMGDatabase()
database.loadOld(inputPath)
try:
os.makedirs(outputPath)
except:
pass
print 'Saving the new RMG-Py database...'
database.save(outputPath)
print "Done!"
示例3: parseCommandLineArguments
# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import loadOld [as 别名]
return groupValues, groupUncertainties
################################################################################
if __name__ == '__main__':
# Parse the command-line arguments
args = parseCommandLineArguments()
inputDirectory = os.path.abspath(args.input[0])
outputDirectory = os.path.abspath(args.output[0])
# Load the old RMG-Java database
print 'Loading old RMG-Java database...'
database = RMGDatabase()
database.loadOld(inputDirectory)
# Generate kinetics group additivity values from old rate rules
print 'Generating kinetics group additivity values...'
Tdata = [300,400,500,600,800,1000,1500,2000]
for familyLabel, family in database.kinetics.groups.iteritems():
print ' %s...' % (familyLabel)
# Determine units of generated rate coefficients
numReactants = len(family.forwardTemplate.reactants)
if numReactants == 1:
kunits = 's^-1'
elif numReactants == 2:
kunits = 'm^3/(mol*s)'
else:
raise Exception("Unexpected number of reactants %i in forward template of reaction family %s." % (numReactants, familyLabel))