コード例 #1
0
    def setUpClass(cls):
        """This method is run once before all tests in this class."""
        test_dir = rmgpy.settings['test_data.directory']

        data_dir = os.path.join(test_dir, 'testing_database')
        chem_dir = os.path.join(test_dir, 'parsing_data')
        chemkin_file = os.path.join(chem_dir, 'chem_annotated.inp')
        spc_dict = os.path.join(chem_dir, 'species_dictionary.txt')

        cls.uncertainty = Uncertainty(outputDirectory='chemDir')
        cls.uncertainty.loadModel(chemkin_file, spc_dict)

        # load database properly
        cls.uncertainty.database = RMGDatabase()
        cls.uncertainty.database.load(
            data_dir,
            kineticsFamilies=[
                '1,2_shiftC', '6_membered_central_C-C_shift',
                'Disproportionation', 'H_Abstraction', 'Intra_ene_reaction',
                'intra_H_migration', 'Intra_R_Add_Exo_scission',
                'intra_substitutionS_isomerization', 'R_Addition_MultipleBond',
                'R_Recombination'
            ],
            kineticsDepositories=['training'],
            thermoLibraries=['primaryThermoLibrary'],
            reactionLibraries=['GRI-Mech3.0'],
        )

        # Prepare the database by loading training reactions and averaging the rate rules verbosely
        for family in cls.uncertainty.database.kinetics.families.itervalues():
            family.addKineticsRulesFromTrainingSet(
                thermoDatabase=cls.uncertainty.database.thermo)
            family.fillKineticsRulesByAveragingUp(verbose=True)
コード例 #2
0
    def setUpClass(cls):
        """This method is run once before all tests in this class."""
        test_dir = rmgpy.settings['test_data.directory']

        data_dir = os.path.join(test_dir, 'testing_database')
        chem_dir = os.path.join(test_dir, 'parsing_data')
        chemkin_file = os.path.join(chem_dir, 'chem_annotated.inp')
        spc_dict = os.path.join(chem_dir, 'species_dictionary.txt')

        cls.uncertainty = Uncertainty(outputDirectory='chemDir')
        cls.uncertainty.loadModel(chemkin_file, spc_dict)

        # load database properly
        cls.uncertainty.database = RMGDatabase()
        cls.uncertainty.database.load(
            data_dir,
            kineticsFamilies='all',
            kineticsDepositories=['training'],
            thermoLibraries=['primaryThermoLibrary'],
            reactionLibraries=['GRI-Mech3.0'],
        )

        # Prepare the database by loading training reactions and averaging the rate rules verbosely
        for family in cls.uncertainty.database.kinetics.families.itervalues():
            family.addKineticsRulesFromTrainingSet(
                thermoDatabase=cls.uncertainty.database.thermo)
            family.fillKineticsRulesByAveragingUp(verbose=True)