Changeset 2630


Ignore:
Timestamp:
May 21, 2010 10:47:57 AM (11 years ago)
Author:
wehart
Message:

Restricting the symbols that are exported from coopr.pyomo.base explicitly.
For some reason, the all specifications are not sufficient to eliminate
the symbol names for modules within coopr.pyomo.base.

This fixes #4052

Location:
coopr.pyomo/trunk/coopr/pyomo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/__init__.py

    r2611 r2630  
    3030from util import *
    3131from rangeset import *
     32
     33#
     34# This is a hack to strip out modules, which shouldn't have been included in these imports
     35#
     36import types
     37_locals = locals()
     38__all__ = [__name for __name in _locals.keys() if (not __name.startswith('_') and not isinstance(_locals[__name],types.ModuleType)) or __name == '_' ]
     39__all__.append('pyomo')
  • coopr.pyomo/trunk/coopr/pyomo/io/cpxlp.py

    r2592 r2630  
    1414
    1515from coopr.opt import ProblemFormat
    16 from coopr.pyomo.base import expr, Var, Constraint, Objective
     16from coopr.pyomo.base import expr, Var, Constraint, Objective, NumericConstant
    1717from coopr.pyomo.base.var import _VarValue, _VarBase
    1818from coopr.pyomo.base.param import _ParamValue
     
    180180                   if not isinstance(base,expr._SumExpression):
    181181                       raise ValueError, "Quadratic term base must be a _SumExpression"
    182                    if not isinstance(exponent,numvalue.NumericConstant):
     182                   if not isinstance(exponent,NumericConstant):
    183183                       raise ValueError, "Quadratic term exponent must be a NumericConstant"
    184184                   variable = base._args[0]
     
    208208                         print >>OUTPUT, " - " + str(objective_offset) + " ONE_VAR_CONSTANT"
    209209                     
    210             elif isinstance(arg,numvalue.NumericConstant):
     210            elif isinstance(arg,NumericConstant):
    211211                # this is the "0.0" element that forms the initial expression - the
    212212                # quadratic sub-expressions aren't known to the presolve routines.
Note: See TracChangeset for help on using the changeset viewer.