Ignore:
Timestamp:
Mar 8, 2010 10:53:13 PM (10 years ago)
Author:
jwatson
Message:

Significantly improved performance of PyomoModel? _clear_attribute method, mainly by eliminate unnecessary calls to it through _setattr_exec_.

File:
1 edited

Legend:

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

    r2359 r2415  
    187187    def _clear_attribute(self,name):
    188188        #
    189         # Cleanup Old Model Declaration First
     189        # cleanup the pre-existing model attribute
    190190        #
    191191        i=0
     
    202202
    203203    def _setattr_exec(self,name,val):
    204         self._clear_attribute(name)
     204        if name in self.__dict__:
     205           self._clear_attribute(name)
    205206        val.name=name
    206207        self._add_temporary_set(val)
Note: See TracChangeset for help on using the changeset viewer.