Changeset 9465


Ignore:
Timestamp:
Dec 1, 2014 12:33:56 AM (4 years ago)
Author:
wehart
Message:

Changes to use the 'pyomo' plugin
environment.

Fixes to use the pyomo.repn.compute_canonical_repn
plugin, rather than the pyomo.model.compute_canonical_repn
plugin.

Location:
pyomo/trunk/pyomo
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/pyomo/bilevel/__init__.py

    r9239 r9465  
    11# Package files
     2
     3from pyomo.util.plugin import PluginGlobals
     4PluginGlobals.add_env("pyomo")
    25
    36from pyomo.bilevel.components import *
    47
     8PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/bilevel/plugins/solver1.py

    r9272 r9465  
    6464            dual_submodel = getattr(self._instance, name_+'_dual')
    6565            dual_submodel.deactivate()
    66             pyomo.util.PyomoAPIFactory('pyomo.model.compute_canonical_repn')({}, model=submodel)
     66            pyomo.util.PyomoAPIFactory('pyomo.repn.compute_canonical_repn')({}, model=submodel)
    6767            #compute_canonical_repn(submodel)
    6868            self._instance.reclassify_component_type(name_, Block)
  • pyomo/trunk/pyomo/checker/__init__.py

    r9246 r9465  
     1from pyomo.util.plugin import PluginGlobals
     2PluginGlobals.add_env("pyomo")
     3
    14from pyomo.checker.checker import *
    25from pyomo.checker.runner import *
     
    1720# Hooks
    1821__all__.extend(['IPreCheckHook', 'IPostCheckHook'])
     22
     23PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/core/__init__.py

    r9246 r9465  
    99#  _________________________________________________________________________
    1010
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
     13
    1114from pyomo.core.base import *
    1215import pyomo.core.base._pyomo
     
    1417import pyomo.core.preprocess
    1518
     19PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/dae/__init__.py

    r9315 r9465  
    1111# Import the key modeling componente here...
    1212
     13from pyomo.util.plugin import PluginGlobals
     14PluginGlobals.add_env("pyomo")
     15
    1316from pyomo.dae.contset import ContinuousSet
    1417from pyomo.dae.diffvar import DAE_Error, StateVar, DerivativeVar
    1518from pyomo.dae.integral import Integral
    1619
     20PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/environ/__init__.py

    r9271 r9465  
    1414if sys.version_info > (3,0):
    1515    import importlib
     16from pyomo.util.plugin import PluginGlobals
     17
    1618
    1719#
     
    6365            pkg.load()
    6466
     67PluginGlobals.add_env("pyomo")
    6568import_packages()
     69PluginGlobals.pop_env()
    6670
  • pyomo/trunk/pyomo/gdp/__init__.py

    r9242 r9465  
    99#  _________________________________________________________________________
    1010
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
     13
    1114from pyomo.gdp.disjunct import GDP_Error, Disjunct, Disjunction
    1215import pyomo.gdp.bigm
    1316import pyomo.gdp.chull
    1417
     18PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/mpec/__init__.py

    r9242 r9465  
    99#  _________________________________________________________________________
    1010
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
     13
    1114from pyomo.mpec.complementarity import Complementarity, complements
    1215
     16PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/openopt/__init__.py

    r9239 r9465  
     1from pyomo.util.plugin import PluginGlobals
     2PluginGlobals.add_env("pyomo")
     3
    14from pyomo.openopt.func_designer import *
     5
     6PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/opt/__init__.py

    r9242 r9465  
    99#  _________________________________________________________________________
    1010
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
     13
    1114from pyomo.opt.base import *
    1215from pyomo.opt.results import *
     
    1518from pyomo.opt.parallel import *
    1619
     20PluginGlobals.pop_env()
     21
  • pyomo/trunk/pyomo/os/__init__.py

    r9242 r9465  
    99#  _________________________________________________________________________
    1010
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
     13
    1114from pyomo.os.OSrL import *
    1215import pyomo.os.OSSolverService
     16
     17PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/pysp/__init__.py

    r9350 r9465  
    88#  For more information, see the Pyomo README.txt file.
    99#  _________________________________________________________________________
     10
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
    1013
    1114import pyomo.pysp.log_config
     
    2528from pyomo.pysp.drive_lagrangian_cc import *
    2629
     30PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/pysp/phutils.py

    r9449 r9465  
    3535from pyomo.repn.compute_ampl_repn import preprocess_block_constraints as ampl_preprocess_block_constraints
    3636
    37 canonical_expression_preprocessor = pyomo.util.PyomoAPIFactory("pyomo.model.compute_canonical_repn")
     37canonical_expression_preprocessor = pyomo.util.PyomoAPIFactory("pyomo.repn.compute_canonical_repn")
    3838
    3939#
  • pyomo/trunk/pyomo/repn/__init__.py

    r9284 r9465  
    99#  _________________________________________________________________________
    1010
     11from pyomo.util.plugin import PluginGlobals
     12PluginGlobals.add_env("pyomo")
     13
    1114from pyomo.repn.canonical_repn import *
    1215from pyomo.repn.linear_repn import *
     
    1417
    1518import pyomo.repn.compute_canonical_repn
     19
     20PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/scripting/__init__.py

    r9252 r9465  
    88#  _________________________________________________________________________
    99
     10from pyomo.util.plugin import PluginGlobals
     11PluginGlobals.add_env("pyomo")
     12
    1013import pyomo.scripting.pyomo_command
    1114import pyomo.scripting.util
    1215
     16PluginGlobals.pop_env()
  • pyomo/trunk/pyomo/util/_task.py

    r9460 r9465  
    1414import pyutilib.misc
    1515from pyomo.util import plugin
     16
     17plugin.PluginGlobals.add_env("pyomo")
    1618
    1719
     
    352354    return retval
    353355
     356
     357plugin.PluginGlobals.pop_env()
     358
  • pyomo/trunk/pyomo/util/plugin.py

    r9451 r9465  
    99#  _________________________________________________________________________
    1010
    11 __all__ = ['Plugin', 'implements', 'Interface', 'CreatePluginFactory', 'PluginMeta', 'alias', 'ExtensionPoint', 'SingletonPlugin', 'PluginFactory', 'PluginError']
     11__all__ = ['Plugin', 'implements', 'Interface', 'CreatePluginFactory', 'PluginMeta', 'alias', 'ExtensionPoint', 'SingletonPlugin', 'PluginFactory', 'PluginError', 'PluginGlobals']
    1212
    1313import sys
     
    1919    # Plugins defined with pyutilib.component.core
    2020    #
    21     from pyutilib.component.core import Plugin, implements, Interface, CreatePluginFactory, PluginMeta, alias, ExtensionPoint, SingletonPlugin, PluginFactory, PluginError
     21    from pyutilib.component.core import Plugin, implements, Interface, CreatePluginFactory, PluginMeta, alias, ExtensionPoint, SingletonPlugin, PluginFactory, PluginError, PluginGlobals
    2222
    2323    def push(name):
Note: See TracChangeset for help on using the changeset viewer.