Changeset 3310


Ignore:
Timestamp:
Dec 4, 2010 11:57:05 PM (10 years ago)
Author:
wehart
Message:

Removing logic that was added to support deep copying in Python 2.4

Location:
coopr.pyomo/trunk/coopr/pyomo/base
Files:
8 edited

Legend:

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

    r3309 r3310  
    4949    def __init__ ( self, name='unknown', **kwargs ):
    5050        """Constructor"""
    51         if kwargs.pop('_deep_copying', None):
    52             # Hack for Python 2.4 compatibility
    53             # Deep copy will copy all items as necessary, so no need to
    54             # complete parsing
    55             return
    56 
    5751        Block.__init__(self, ctype=Model)
    5852        #
  • coopr.pyomo/trunk/coopr/pyomo/base/component.py

    r2906 r3310  
    1111
    1212    def __init__ ( self, ctype=None, **kwargs ):
    13         if kwargs.pop('_deep_copying', None):
    14             # Hack for Python 2.4 compatibility
    15             # Deep copy will copy all items as necessary, so no need to
    16             # complete parsing
    17             return
    18 
    1913        # Error check for ctype
    2014        if ctype is None:
  • coopr.pyomo/trunk/coopr/pyomo/base/constraint.py

    r3272 r3310  
    4242
    4343    def __init__(self, *args, **kwargs):
    44         if kwargs.pop('_deep_copying', None):
    45             # Hack for Python 2.4 compatibility
    46             # Deep copy will copy all items as necessary, so no need to
    47             # complete parsing
    48             return
    49 
    5044        ctype = {'ctype': kwargs.pop("ctype", None)}
    5145        IndexedComponent.__init__(self, *args, **ctype)
     
    143137        doc:  documentation string for constraint
    144138        """
    145         if kwargs.pop('_deep_copying', None):
    146             # Hack for Python 2.4 compatibility
    147             # Deep copy will copy all items as necessary, so no need to
    148             # complete parsing
    149             return
    150 
    151139        # See if 'ctype' was passed as a keyword argument;
    152140        # this allows derived classses to alert Pyomo to
     
    602590
    603591    def __init__(self, *args, **kwargs):
    604         if kwargs.pop('_deep_copying', None):
    605             # Hack for Python 2.4 compatibility
    606             # Deep copy will copy all items as necessary, so no need to
    607             # complete parsing
    608             return
    609 
    610592        name = kwargs.get('name', 'unknown')
    611593
  • coopr.pyomo/trunk/coopr/pyomo/base/objective.py

    r3166 r3310  
    5050           expression
    5151        """
    52         if kwargs.pop('_deep_copying', None):
    53             # Hack for Python 2.4 compatibility
    54             # Deep copy will copy all items as necessary, so no need to
    55             # complete parsing
    56             return
    57 
    5852        tkwargs = {'ctype':Objective}
    5953        IndexedComponent.__init__(self, *args, **tkwargs)
  • coopr.pyomo/trunk/coopr/pyomo/base/param.py

    r3309 r3310  
    9494    """
    9595    def __init__(self, *args, **kwd):
    96         if kwd.pop('_deep_copying', None):
    97             # Hack for Python 2.4 compatibility
    98             # Deep copy will copy all items as necessary, so no need to
    99             # complete parsing
    100             return
    101 
    10296        tkwd = {'ctype': kwd.pop("ctype", Param)}
    10397        IndexedComponent.__init__(self, *args, **tkwd)
  • coopr.pyomo/trunk/coopr/pyomo/base/rangeset.py

    r3167 r3310  
    4040    def __init__(self,*args,**kwds):
    4141        """Construct a list of integers"""
    42         if kwds.pop('_deep_copying', None):
    43             # Hack for Python 2.4 compatibility
    44             # Deep copy will copy all items as necessary, so no need to
    45             # complete parsing
    46             return
    47 
    4842        tmp=()
    4943        sets._SetContainer.__init__(self,*tmp,**kwds)
  • coopr.pyomo/trunk/coopr/pyomo/base/set_types.py

    r3150 r3310  
    3535
    3636    def __init__(self,*args,**kwds):
    37         if kwds.pop('_deep_copying', None):
    38             # Hack for Python 2.4 compatibility
    39             # Deep copy will copy all items as necessary, so no need to
    40             # complete parsing
    41             return
    42 
    4337        if "name" in kwds:
    4438            pyutilib.component.core.Plugin.__init__(self,name=kwds["name"])
     
    7165    def __init__(self,*args,**kwds):
    7266        """Constructor"""
    73         if kwds.pop('_deep_copying', None):
    74             # Hack for Python 2.4 compatibility
    75             # Deep copy will copy all items as necessary, so no need to
    76             # complete parsing
    77             return
    78 
    7967        if not 'bounds' in kwds:
    8068            kwds['bounds'] = (None,None)
  • coopr.pyomo/trunk/coopr/pyomo/base/var.py

    r3276 r3310  
    3232    """Holds the numeric value of a variable, along with suffix info"""
    3333
    34     def __init__(self,**kwds):
     34    def __init__(self, **kwds):
    3535        """Constructor"""
    36         if kwds.pop('_deep_copying', None):
    37             # Hack for Python 2.4 compatibility
    38             # Deep copy will copy all items as necessary, so no need to
    39             # complete parsing
    40             return
    41 
    4236        # NOTE: we currently use the name (in the base class), id, and label attributes,
    4337        #       but don't document their differences anywhere!
     
    207201    # TODO: default and rule keywords are not used?  Need to talk to Bill ...?
    208202    def __init__(self, *args, **kwd):
    209         if kwd.pop('_deep_copying', None):
    210             # Hack for Python 2.4 compatibility
    211             # Deep copy will copy all items as necessary, so no need to
    212             # complete parsing
    213             return
    214 
    215203        tkwd = {'ctype':Var}
    216204        IndexedComponent.__init__(self, *args, **tkwd)
     
    577565
    578566    def __init__(self, *args, **kwd):
    579         if kwd.pop('_deep_copying', None):
    580             # Hack for Python 2.4 compatibility
    581             # Deep copy will copy all items as necessary, so no need to
    582             # complete parsing
    583             return
    584 
    585567        _VarValue.__init__(self, **kwd)
    586568        _VarBase.__init__(self, *args, **kwd)
     
    600582
    601583    def __init__(self, *args, **kwd):
    602         if kwd.pop('_deep_copying', None):
    603             # Hack for Python 2.4 compatibility
    604             # Deep copy will copy all items as necessary, so no need to
    605             # complete parsing
    606             return
    607 
    608584        _VarBase.__init__(self, *args, **kwd)
    609585        self._dummy_val = _VarValue(**kwd)
     
    641617
    642618    def __new__(cls, *args, **kwds):
    643         if kwds.pop('_deep_copying', None):
    644             # Hack for Python 2.4 compatibility
    645             # Deep copy will copy all items as necessary, so no need to
    646             # complete parsing
    647             return
    648 
    649619        if args == ():
    650620            self = _VarElement(*args, **kwds)
Note: See TracChangeset for help on using the changeset viewer.