Example #1
0
#  _________________________________________________________________________
#
#  Pyomo: Python Optimization Modeling Objects
#  Copyright (c) 2014 Sandia Corporation.
#  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
#  the U.S. Government retains certain rights in this software.
#  This software is distributed under the BSD License.
#  _________________________________________________________________________

# Package files

from pyomo.util.plugin import PluginGlobals

PluginGlobals.add_env("pyomo")

from pyomo.bilevel.components import *

PluginGlobals.pop_env()
Example #2
0
import pyomo.pysp.solutionioextensions
import pyomo.pysp.util
#import pyomo.pysp.ef_vss
import pyomo.pysp.phsolverserverutils
import pyomo.pysp.solutionwriter
import pyomo.pysp.phextension
import pyomo.pysp.phutils
import pyomo.pysp.dualphmodel
import pyomo.pysp.generators
import pyomo.pysp.convergence
import pyomo.pysp.scenariotree
import pyomo.pysp.phobjective
import pyomo.pysp.embeddedsp

import pyomo.pysp.ef
import pyomo.pysp.ph
import pyomo.pysp.lagrangeutils

import pyomo.pysp.phsolverserver
import pyomo.pysp.ef_writer_script
import pyomo.pysp.phinit
import pyomo.pysp.computeconf
import pyomo.pysp.drive_lagrangian_cc
import pyomo.pysp.lagrangeMorePR
import pyomo.pysp.lagrangeParam
import pyomo.pysp.convert
import pyomo.pysp.solvers
import pyomo.pysp.benders

PluginGlobals.pop_env()
Example #3
0
            exctype = err = tb = None
            # TODO: Should this just log an error and re-raise the
            # original exception?
            raise ImportError(msg)

        pkg = _sys.modules[pname]
        pkg.load()
    #
    # Import optional packages
    #
    for name in _optional_packages:
        pname = name + '.plugins'
        try:
            _do_import(pname)
        except ImportError:
            continue
        pkg = _sys.modules[pname]
        pkg.load()


from pyomo.util.plugin import PluginGlobals as _PG
_PG.add_env("pyomo")
_import_packages()
_PG.pop_env()

#
# Expose the symbols from pyomo.core
#
from pyomo.core import *
from pyomo.opt import SolverFactory, SolverManagerFactory, UnknownSolver
Example #4
0
    for name in _packages:
        pname = name+'.plugins'
        try:
            _do_import(pname)
        except ImportError:
            if name in _optional_packages:
                # Note: Continue to avoid the package load().
                #
                # TODO: Should this generate a warning if the package exists
                # on the file system?
                continue
            else:
                exctype, err, tb = _sys.exc_info()  # BUG?
                import traceback
                msg = "pyomo.environ failed to import %s:\nOriginal %s: %s\n"\
                      "Traceback:\n%s" \
                      % (pname, exctype.__name__, err,
                         ''.join(traceback.format_tb(tb)),)
                # clear local variables to remove circular references
                exctype = err = tb = None
                # TODO: Should this just log an error and re-raise the
                # original exception?
                raise ImportError(msg)

        pkg = _sys.modules[pname]
        pkg.load()

_PG.add_env("pyomo")
_import_packages()
_PG.pop_env()