Changeset 2823


Ignore:
Timestamp:
Jul 20, 2010 1:48:45 PM (9 years ago)
Author:
prsteel
Message:

Rule detection did not properly check for callable objects. Previously inspect.isroutine was used, which does not check for functors. Replaced with isfunctor, defined in coopr.pyomo.base.util.

File:
1 edited

Legend:

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

    r2797 r2823  
    1010
    1111__all__ = ['Var', 'VarStatus', '_VarBase', "Piecewise"]
    12 
    13 from inspect import isroutine
    1412
    1513from component import Component
     
    2624import sys
    2725from param import _ParamValue
     26from coopr.pyomo.base.util import isfunctor
    2827
    2928VarStatus = Enum( 'undefined', 'fixed_by_presolve', 'fixed_by_optimizer',
     
    190189
    191190        # Check for domain rules
    192         if isroutine(self.domain):
     191        if isfunctor(self.domain):
    193192            self._domain_rule = self.domain
    194193
Note: See TracChangeset for help on using the changeset viewer.