示例#1
0
def setUpModule():
    """
    A method that is run before the class.
    """
    # set-up RMG object and get global rmg object in input.py file
    # so methods can be tested
    global rmg
    rmg = RMG()
    inp.set_global_rmg(rmg)
示例#2
0
    def setUpClass(cls):
        """
        A method that is run ONCE before all unit tests in this class.
        """
        cls.dirname = os.path.abspath(
            os.path.join(os.path.dirname(__file__), 'temp'))
        os.makedirs(os.path.join(cls.dirname, 'pdep'))

        test_family = 'R_Recombination'

        cls.rmg = RMG()

        from rmgpy.rmg.input import set_global_rmg, pressure_dependence
        set_global_rmg(cls.rmg)

        pressure_dependence(
            method='modified strong collision',
            maximumGrainSize=(0.5, 'kcal/mol'),
            minimumNumberOfGrains=250,
            temperatures=(300, 2100, 'K', 8),
            pressures=(0.1, 100, 'bar', 5),
            interpolation=('Chebyshev', 6, 4),
            maximumAtoms=10,
        )

        cls.rmg.output_directory = cls.rmg.pressure_dependence.output_file = cls.dirname

        cls.rmg.database = RMGDatabase()
        cls.rmg.database.load(
            path=settings['database.directory'],
            thermo_libraries=['primaryThermoLibrary'],
            kinetics_families=[test_family],
            reaction_libraries=[],
        )

        cls.rmg.reaction_model = CoreEdgeReactionModel()
        cls.rmg.reaction_model.pressure_dependence = cls.rmg.pressure_dependence