Changeset 2356


Ignore:
Timestamp:
Feb 15, 2010 8:28:17 PM (10 years ago)
Author:
wehart
Message:

Merged revisions 2314-2355 via svnmerge from
https://software.sandia.gov/svn/public/coopr/coopr.plugins/trunk

........

r2326 | jwatson | 2010-02-12 09:03:09 -0700 (Fri, 12 Feb 2010) | 3 lines


Adding import of cPickle instead of pickle, if it exists.

........

r2332 | wehart | 2010-02-14 13:50:07 -0700 (Sun, 14 Feb 2010) | 2 lines


Misc change in svn:ignore properties

........

r2334 | wehart | 2010-02-15 13:14:20 -0700 (Mon, 15 Feb 2010) | 2 lines


Updating GLPK test to work when pico_convert is not available.

........

r2335 | wehart | 2010-02-15 13:37:29 -0700 (Mon, 15 Feb 2010) | 2 lines


Misc fix to setup glpk suffixes that are parsed.

........

r2336 | wehart | 2010-02-15 13:42:10 -0700 (Mon, 15 Feb 2010) | 2 lines


Misc documentation update.

........

r2343 | wehart | 2010-02-15 13:44:17 -0700 (Mon, 15 Feb 2010) | 2 lines


Extending definition of svn:ignore to include *.egg-info files.

........

r2348 | wehart | 2010-02-15 13:49:48 -0700 (Mon, 15 Feb 2010) | 2 lines


Bug fix due to typo.

........

r2349 | wehart | 2010-02-15 15:13:14 -0700 (Mon, 15 Feb 2010) | 5 lines


Adding a hack to detect whether CBC has compiled-in support for
AMPL *.nl files.


This really mucks with the test semantics... :(

........

r2351 | wehart | 2010-02-15 16:52:52 -0700 (Mon, 15 Feb 2010) | 3 lines


Bug fix in coopr.plugins registration, due to change in
module CBC to CBCplugins

........

r2352 | wehart | 2010-02-15 17:37:33 -0700 (Mon, 15 Feb 2010) | 2 lines


Setting up the configuration of CBC.

........

Location:
coopr.plugins/stable/2.3
Files:
1 deleted
19 edited
1 copied

Legend:

Unmodified
Added
Removed
  • coopr.plugins/stable/2.3

  • coopr.plugins/stable/2.3/coopr

    • Property svn:ignore set to
      *.pyc
      *.pyo
      *.cover
      *.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/converter

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/mip

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/mip/GLPK.py

    r2314 r2356  
    443443                if lp_solution is True:
    444444                   state_string = line[20:22].strip()
    445                    marginal_string = line[65:78].strip()                               
     445                   marginal_string = line[65:78].strip()
    446446
    447447                   if (activity_string != "< eps") and (len(activity_string) > 0):
  • coopr.plugins/stable/2.3/coopr/plugins/mip/__init__.py

    r2215 r2356  
    1313
    1414from PICO import PICO, MockPICO
    15 from CBC import CBC, MockCBC
     15from CBCplugin import CBC, MockCBC
    1616from GLPK import GLPK, MockGLPK
    1717from CPLEX import CPLEX, MockCPLEX
     
    1919#from NLWRITE import NLWRITE
    2020
     21#   
     22# Interrogate the CBC executable to see if it recognizes the -AMPL flag
     23#   
     24import CBCplugin
     25CBCplugin.configure()
     26
    2127pyutilib.component.core.PluginGlobals.pop_env()
     28
  • coopr.plugins/stable/2.3/coopr/plugins/smanager

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/smanager/pyro.py

    r2314 r2356  
    1212__all__ = []
    1313
    14 import pyutilib.misc
    15 import pyutilib.component.core
    16 from coopr.opt.parallel.manager import *
    17 from coopr.opt.parallel.solver import *
    18 from coopr.opt.results import SolverResults
    19 
    20 import pickle
     14try:
     15    import cPickle as pickle
     16except ImportError:
     17    import pickle
    2118
    2219try:
     
    2623except ImportError:
    2724    using_pyro=False
    28        
     25
     26import pyutilib.misc
     27import pyutilib.component.core
     28from coopr.opt.parallel.manager import *
     29from coopr.opt.parallel.solver import *
     30from coopr.opt.results import SolverResults
    2931
    3032class SolverManager_Pyro(AsynchronousSolverManager):
  • coopr.plugins/stable/2.3/coopr/plugins/tests

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/asl

    • Property svn:ignore set to
      *.pyc
      *.pyo
      *.cover
      *.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/cbc

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/cplex

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/glpk

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/pico

    • Property svn:ignore
      •  

        old new  
        22*.pyo
        33*.cover
         4*.egg-info
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_cbc.py

    r2314 r2356  
    2929    cbc_available=False
    3030    pass
     31
     32try:
     33    pico_convert =  pyutilib.services.registered_executable("pico_convert")
     34    pico_convert_available= (not pico_convert is None)
     35except pyutilib.common.ApplicationError:
     36    pico_convert_available=False
     37
    3138
    3239
     
    9198    def test_solve4(self):
    9299        """ Test CBC - test4.nl """
    93         results = self.cbc.solve(currdir+"test4.nl", rformat=ResultsFormat.sol, logfile=currdir+"test_solve4.log", solnfile=currdir+"test4.soln")
    94         results.write(filename=currdir+"test_solve4.txt",times=False)
    95         self.failUnlessFileEqualsBaseline(currdir+"test_solve4.txt", currdir+"test4_cbc.txt")
    96         os.remove(currdir+"test_solve4.log")
    97         if os.path.exists(currdir+"ipconvert.lp"):
    98            os.remove(currdir+"ipconvert.lp")
    99         #os.remove(currdir+"test4.soln")
     100        try:
     101            results = self.cbc.solve(currdir+"test4.nl", rformat=ResultsFormat.sol, logfile=currdir+"test_solve4.log", solnfile=currdir+"test4.soln")
     102            results.write(filename=currdir+"test_solve4.txt",times=False)
     103            self.failUnlessFileEqualsBaseline(currdir+"test_solve4.txt", currdir+"test4_cbc.txt")
     104            #os.remove(currdir+"test_solve4.log")
     105            if os.path.exists(currdir+"ipconvert.lp"):
     106                os.remove(currdir+"ipconvert.lp")
     107        except coopr.opt.ConverterError:
     108            if pico_convert_available:
     109                raise "Expected conversion of test4.nl to a format that CBC can solve"
    100110       
    101111    #
     
    121131        os.remove(currdir+"prod.soln")
    122132       
    123     def test_error1(self):
     133    def Xtest_error1(self):
    124134        """ Bad results format """
    125135        try:
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_glpk.py

    r2314 r2356  
    3232    glpk_available=False
    3333    pass
     34
     35try:
     36    pico_convert =  pyutilib.services.registered_executable("pico_convert")
     37    pico_convert_available= (not pico_convert is None)
     38except pyutilib.common.ApplicationError:
     39    pico_convert_available=False
     40
    3441
    3542
     
    9198    def test_solve4(self):
    9299        """ Test GLPK - test4.nl """
    93         results = self.glpk.solve(currdir+"test4.nl", rformat=ResultsFormat.soln, logfile=currdir+"test_solve4.log", solnfile=currdir+"test4.soln")
    94         results.write(filename=currdir+"test_solve4.txt", times=False)
    95         self.failUnlessFileEqualsBaseline(currdir+"test_solve4.txt", currdir+"test4_glpk.txt")
    96         os.remove(currdir+"test_solve4.log")
    97         #if os.path.exists(currdir+"ipconvert.lp"):
    98            #os.remove(currdir+"ipconvert.lp")
    99         os.remove(currdir+"test4.soln")
     100        if pico_convert_available:
     101            results = self.glpk.solve(currdir+"test4.nl", rformat=ResultsFormat.soln, logfile=currdir+"test_solve4.log")
     102            results.write(filename=currdir+"test_solve4.txt",times=False)
     103            self.failUnlessFileEqualsBaseline(currdir+"test_solve4.txt", currdir+"test4_glpk.txt")
     104            os.remove(currdir+"test4.soln")
     105            os.remove(currdir+"test_solve4.log")
     106        else:
     107            try:
     108                results = self.glpk.solve(currdir+"test4.nl", rformat=ResultsFormat.soln, logfile=currdir+"test_solve4.log")
     109            except coopr.opt.ConverterError:
     110                pass
     111
    100112       
    101113    def Xtest_solve5(self):
  • coopr.plugins/stable/2.3/setup.py

    r2240 r2356  
    7474            'converter.pico = coopr.plugins.converter.pico',
    7575            'converter.pyomo = coopr.plugins.converter.pyomo',
    76             'solver.cbc = coopr.plugins.mip.CBC',
     76            'solver.cbc = coopr.plugins.mip.CBCplugin',
    7777            'solver.cplex = coopr.plugins.mip.CPLEX',
    7878            'solver.pico = coopr.plugins.mip.PICO',
Note: See TracChangeset for help on using the changeset viewer.