Changeset 4060


Ignore:
Timestamp:
05/06/11 20:19:42 (3 years ago)
Author:
wehart
Message:

Reformatting with reindent

Location:
coopr.gdp/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • coopr.gdp/trunk/coopr/__init__.py

    r3361 r4060  
    1616    import pkgutil 
    1717    __path__ = pkgutil.extend_path(__path__, __name__) 
    18  
  • coopr.gdp/trunk/coopr/gdp/chull.py

    r3854 r4060  
    5656            else: 
    5757                return str(idx) 
    58              
     58 
    5959        # Correlate the disaggregated variables across the disjunctions 
    6060        for Disj in comp_map.get(Disjunction, {}).itervalues(): 
     
    153153                # from the expression and put them into the lb/ub 
    154154                constant = cannonical.get(0, {}).get(None,0) 
    155                  
     155 
    156156            if c.lower is not None: 
    157157                if __debug__ and logger.isEnabledFor(logging.DEBUG): 
     
    178178                instance._add_component( name+"_hi", newC ) 
    179179                newC.construct() 
    180                                           
     180 
    181181    def _var_subst(self, NL, exp, y, varMap): 
    182182        # Recursively traverse the S-expression and substitute all model 
     
    218218                varMap[id(exp)] = (exp, y, v) 
    219219            if NL: 
    220                 return varMap[id(exp)][2] / y  
     220                return varMap[id(exp)][2] / y 
    221221            else: 
    222222                return varMap[id(exp)][2] 
  • coopr.gdp/trunk/coopr/gdp/disjunct.py

    r4042 r4060  
    113113                    tmp.append(self.model) 
    114114                    tmp=tuple(tmp) 
    115                  
     115 
    116116                    _self_rule(*tmp) 
    117117                for tmp in block.components.itervalues(): 
     
    119119                self._data[val] = block 
    120120        #self._index=constructed_indices 
    121          
     121 
    122122 
    123123    def pprint(self, ostream=None): 
    124124        if ostream is None: 
    125            ostream = sys.stdout 
     125            ostream = sys.stdout 
    126126        print >>ostream, "   ",self.name,":", 
    127127        print >>ostream, "\tSize="+str(len(self._data.keys())), 
    128128        if isinstance(self._index,_BaseSet): 
    129            print >>ostream, "\tIndex=",self._index.name 
    130         else: 
    131            print >>ostream,"" 
     129            print >>ostream, "\tIndex=",self._index.name 
     130        else: 
     131            print >>ostream,"" 
    132132        if self._M is not None: 
    133133            print >>ostream, "\tM=", self._M 
     
    223223            msg = 'Bad expression passed to Disjunction' 
    224224            raise TypeError, msg 
    225          
     225 
    226226        for d in disjuncts: 
    227227            if not isinstance(d, Disjunct): 
  • coopr.gdp/trunk/coopr/gdp/tests/test_gdp.py

    r3751 r4060  
    2727import pyutilib.th as unittest 
    2828import coopr.pyomo.scripting.pyomo as main 
    29 import StringIO  
     29import StringIO 
    3030from pyutilib.misc import setup_redirect, reset_redirect 
    3131import re 
     
    9595    def check(self, problem, solver): 
    9696        pass 
    97      
     97 
    9898    def referenceFile(self, problem, solver): 
    9999        return join(currdir, problem+'.txt') 
     
    113113            if key.startswith('test'): 
    114114                getattr(self,key).__doc__ = " (%s)" % getattr(self,key).__name__ 
    115      
     115 
    116116    def test_bigm_jobshop_small(self): 
    117117        """Run the small jobshop example using the BigM transformation""" 
     
    171171        kwds['solver'] = 'cplex' 
    172172        CommonTests.pyomo(self, *args, **kwds) 
    173          
     173 
    174174Solve_GLPK = unittest.skipIf(pyutilib.services.registered_executable("glpsol") is None, "The 'glpsol' executable is not available")(Solve_GLPK) 
    175175Solve_CPLEX = unittest.skipIf(pyutilib.services.registered_executable("cplex") is None, "The 'cplex' executable is not available")(Solve_CPLEX) 
    176176 
    177177if __name__ == "__main__": 
    178    unittest.main() 
     178    unittest.main() 
  • coopr.gdp/trunk/examples/jobshop.py

    r4042 r4060  
    2222# at any stage at any time. The objective is to minimize the makespan, 
    2323# the time to complete all jobs. 
    24 #  
     24# 
    2525# References: 
    26 #  
     26# 
    2727# Raman & Grossmann, Computers and Chemical Engineering 18, 7, p.563-578, 1994. 
    28 #  
     28# 
    2929# Aldo Vecchietti, LogMIP User's Manual, http://www.logmip.ceride.gov.ar/, 2007 
    3030# 
  • coopr.gdp/trunk/setup.py

    r3860 r4060  
    2727        pkg_list.append(path) 
    2828    for root, dirs, files in os.walk(path, topdown=True): 
    29       if root in pkg_list and "__init__.py" in files: 
    30          for name in dirs: 
    31            if os.path.exists(root+os.sep+name+os.sep+"__init__.py"): 
    32               pkg_list.append(root+os.sep+name) 
     29        if root in pkg_list and "__init__.py" in files: 
     30            for name in dirs: 
     31                if os.path.exists(root+os.sep+name+os.sep+"__init__.py"): 
     32                    pkg_list.append(root+os.sep+name) 
    3333    return map(lambda x:x.replace(os.sep,"."), pkg_list) 
    3434 
     
    6666      namespace_packages=['coopr'] 
    6767      ) 
    68  
Note: See TracChangeset for help on using the changeset viewer.