本文整理匯總了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))