Exemplo n.º 1
0
import os.path
import numpy as np
import re
from collections import Counter
import sys

#local imports

#global variables
reactions = None

try:
    from scoop import shared
    from scoop.futures import map as map_
    from scoop import logger as logging
    logging.setLevel(20)#10 : debug, 20: info
except ImportError:
    map_ = map
    import logging
    logging.error('Import Error!')

from rmgpy.chemkin import getSpeciesIdentifier, loadChemkinFile
from rmgpy.rmg.main import RMG
from rmgpy.solver.base import TerminationTime, TerminationConversion
from workerwrapper import WorkerWrapper
"""
Guidelines for input:

- Do not use the annotated chemkin file as input!
- 
"""
        orig_conv = compute_conversion(target_label, reactionModel, reactionSystem, index,\
         rmg.absoluteTolerance, rmg.relativeTolerance)

        tols = [0.7, 1e-3, 1e-6]
        for tol in tols:
            conv = reduce_compute(tol, target_label, reactionModel, rmg, index)
            self.assertIsNotNone(conv)

    def test_optimize(self):
        rmg = OptimizeTest.rmg
        target_label = OptimizeTest.target_label
        error = OptimizeTest.error
        reactionModel = rmg.reactionModel


        atol, rtol = rmg.absoluteTolerance, rmg.relativeTolerance
        index = 0
        reactionSystem = rmg.reactionSystems[index]
        
        #compute original target conversion
        Xorig = compute_conversion(target_label, reactionModel, reactionSystem, index,\
         rmg.absoluteTolerance, rmg.relativeTolerance)

        # optimize reduction tolerance
        tol = optimize_tolerance(target_label, reactionModel, rmg, index, error, Xorig)
        self.assertAlmostEqual(1e-04, tol)


if __name__ == '__main__' and os.environ.get('IS_ORIGIN', "1") == "1":
    logging.setLevel(20)
    unittest.main()
Exemplo n.º 3
0
        orig_conv = compute_conversion(target_label, reactionModel, reactionSystem, index,\
         rmg.absoluteTolerance, rmg.relativeTolerance)

        tols = [0.7, 1e-3, 1e-6]
        for tol in tols:
            conv = reduce_compute(tol, target_label, reactionModel, rmg, index)
            self.assertIsNotNone(conv)

    def test_optimize(self):
        rmg = OptimizeTest.rmg
        target_label = OptimizeTest.target_label
        error = OptimizeTest.error
        reactionModel = rmg.reactionModel

        atol, rtol = rmg.absoluteTolerance, rmg.relativeTolerance
        index = 0
        reactionSystem = rmg.reactionSystems[index]

        #compute original target conversion
        Xorig = compute_conversion(target_label, reactionModel, reactionSystem, index,\
         rmg.absoluteTolerance, rmg.relativeTolerance)

        # optimize reduction tolerance
        tol = optimize_tolerance(target_label, reactionModel, rmg, index,
                                 error, Xorig)
        self.assertAlmostEqual(1e-04, tol)


if __name__ == '__main__' and os.environ.get('IS_ORIGIN', "1") == "1":
    logging.setLevel(20)
    unittest.main()
Exemplo n.º 4
0
import os.path
import numpy as np
import re
from collections import Counter
import sys

#local imports

#global variables
reactions = None

try:
    from scoop import shared
    from scoop.futures import map as map_
    from scoop import logger as logging
    logging.setLevel(20)  #10 : debug, 20: info
except ImportError:
    map_ = map
    import logging
    logging.error('Import Error!')

from rmgpy.chemkin import getSpeciesIdentifier, loadChemkinFile
from rmgpy.rmg.main import RMG
from rmgpy.solver.base import TerminationTime, TerminationConversion
from workerwrapper import WorkerWrapper
"""
Guidelines for input:

- Do not use the annotated chemkin file as input!
- 
"""