Exemplo n.º 1
0
 def _call_impl(self, args, unparsed, logger):
     results = []
     result_fmt = "[%s]  %s"
     returncode = 0
     for target in ExtensionBuilderFactory:
         try:
             ext = ExtensionBuilderFactory(target)
             if hasattr(ext, 'skip') and ext.skip():
                 result = 'SKIP'
             elif hasattr(ext, '__call__'):
                 ext(parallel=args.parallel)
                 result = ' OK '
             else:
                 # Extension was a simple function and already ran
                 result = ' OK '
         except SystemExit:
             _info = sys.exc_info()
             _cls = str(_info[0].__name__
                        if _info[0] is not None else "NoneType") + ": "
             logger.error(_cls + str(_info[1]))
             result = 'FAIL'
             returncode |= 2
         except:
             _info = sys.exc_info()
             _cls = str(_info[0].__name__
                        if _info[0] is not None else "NoneType") + ": "
             logger.error(_cls + str(_info[1]))
             result = 'FAIL'
             returncode |= 1
         results.append(result_fmt % (result, target))
     logger.info("Finished building Pyomo extensions.")
     logger.info("The following extensions were built:\n    " +
                 "\n    ".join(results))
     return returncode
Exemplo n.º 2
0
def load():
    ExtensionBuilderFactory.register('appsi')(AppsiBuilder)
    SolverFactory.register(
        name='appsi_gurobi',
        doc='Automated persistent interface to Gurobi')(Gurobi)
    SolverFactory.register(
        name='appsi_cplex',
        doc='Automated persistent interface to Cplex')(Cplex)
    SolverFactory.register(
        name='appsi_ipopt',
        doc='Automated persistent interface to Ipopt')(Ipopt)
    SolverFactory.register(name='appsi_cbc',
                           doc='Automated persistent interface to Cbc')(Cbc)
Exemplo n.º 3
0
 def call(self, args, unparsed):
     logger = logging.getLogger('pyomo.common')
     logger.setLevel(logging.INFO)
     results = []
     result_fmt = "[%s]  %s"
     returncode = 0
     for target in ExtensionBuilderFactory:
         try:
             ExtensionBuilderFactory(target)
             result = ' OK '
         except SystemExit:
             result = 'FAIL'
             returncode = 1
         except:
             result = 'FAIL'
             returncode = 1
         results.append(result_fmt % (result, target))
     logger.info("Finished building Pyomo extensions.")
     logger.info("The following extensions were built:\n    " +
                 "\n    ".join(results))
     return returncode
Exemplo n.º 4
0
def load():
    ExtensionBuilderFactory.register('pynumero')(PyNumeroBuilder)
    SolverFactory.register(
        'cyipopt',
        doc='Cyipopt: direct python bindings to the Ipopt NLP solver')(
            PyomoCyIpoptSolver)
Exemplo n.º 5
0
def load():
    ExtensionBuilderFactory.register('pynumero')(PyNumeroBuilder)
Exemplo n.º 6
0
def load():
    DownloadFactory.register('mcpp')(get_mcpp)
    ExtensionBuilderFactory.register('mcpp')(MCPPBuilder)
Exemplo n.º 7
0
def load():
    ExtensionBuilderFactory.register('ampl_function_demo')(
        AMPLFunctionDemoBuilder)
Exemplo n.º 8
0
def load():
    DownloadFactory.register('mcpp')(get_mcpp)
    ExtensionBuilderFactory.register('mcpp')(build_mcpp)