当前位置: 首页>>代码示例>>Python>>正文


Python RMGDatabase.save方法代码示例

本文整理汇总了Python中rmgpy.data.rmg.RMGDatabase.save方法的典型用法代码示例。如果您正苦于以下问题:Python RMGDatabase.save方法的具体用法?Python RMGDatabase.save怎么用?Python RMGDatabase.save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rmgpy.data.rmg.RMGDatabase的用法示例。


在下文中一共展示了RMGDatabase.save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: RMGDatabase

# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import save [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!"
开发者ID:Lyle-zhang,项目名称:RMG-database,代码行数:31,代码来源:importOldDatabase.py

示例2: groups

# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import save [as 别名]
# to deal in the Software without restriction, including without limitation   #
# the rights to use, copy, modify, merge, publish, distribute, sublicense,    #
# and/or sell copies of the Software, and to permit persons to whom the       #
# Software is furnished to do so, subject to the following conditions:        #
#                                                                             #
# The above copyright notice and this permission notice shall be included in  #
# all copies or substantial portions of the Software.                         #
#                                                                             #
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,    #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING     #
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER         #
# DEALINGS IN THE SOFTWARE.                                                   #
#                                                                             #
###############################################################################

"""
This script machine writes all the families and groups (no libraries) so that RMG-database looks cleaner
and does not have duplicate indexes
"""

from rmgpy import settings
from rmgpy.data.rmg import RMGDatabase

database = RMGDatabase()
database.load(settings['database.directory'], kineticsFamilies = 'all')

database.save(settings['database.directory'])
开发者ID:ReactionMechanismGenerator,项目名称:RMG-Py,代码行数:32,代码来源:machineWriteDatabase.py

示例3: getUsername

# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import save [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)
开发者ID:ajalan,项目名称:RMG-database,代码行数:32,代码来源:importOldDatabase.py

示例4: database

# 需要导入模块: from rmgpy.data.rmg import RMGDatabase [as 别名]
# 或者: from rmgpy.data.rmg.RMGDatabase import save [as 别名]
                    comment='Fitted from RMG-Java rate rules',
                )
            else:
                entry.data = None

    # Add history item to each entry in each database (saying that JWA added them all!)
    print 'Setting history of all entries in database...'
    event = [time.asctime(),'jwallen','action','jwallen imported this entry from the old RMG database.']
    for depository in database.thermo.depository.values():
        for label, entry in depository.entries.iteritems():
            entry.history.append(event)
    for library in database.thermo.libraries.values():
        for label, entry in library.entries.iteritems():
            entry.history.append(event)
    for groups in database.thermo.groups.values():
        for label, entry in groups.entries.iteritems():
            entry.history.append(event)
    for depository in database.kinetics.depository.values():
        for label, entry in depository.entries.iteritems():
            entry.history.append(event)
    for library in database.kinetics.libraries.values():
        for label, entry in library.entries.iteritems():
            entry.history.append(event)
    for groups in database.kinetics.groups.values():
        for label, entry in groups.entries.iteritems():
            entry.history.append(event)

    # Save the new database
    print 'Saving the new RMG-Py database...'
    database.save(outputDirectory)
开发者ID:ajalan,项目名称:RMG-Py,代码行数:32,代码来源:importOldDatabase.py


注:本文中的rmgpy.data.rmg.RMGDatabase.save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。