Changeset 5721


Ignore:
Timestamp:
04/27/12 13:28:23 (2 years ago)
Author:
jwatson
Message:

Adding tolerances (1e-4) for PySP/ipopt tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/tests/unit/test_ph.py

    r5691 r5721  
    271271        pyutilib.misc.reset_redirect() 
    272272        self.cleanup() 
    273         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_ipopt.out",this_test_file_directory+"farmer_quadratic_ipopt.baseline", filter=filter_time_and_data_dirs) 
     273        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_ipopt.out",this_test_file_directory+"farmer_quadratic_ipopt.baseline", filter=filter_time_and_data_dirs, tolerance=1e-4) 
    274274 
    275275    @unittest.skipIf(not gurobi_available, "The 'gurobi' executable is not available") 
     
    406406        pyutilib.misc.reset_redirect() 
    407407        self.cleanup() 
    408         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_trivial_bundling_ipopt.out",this_test_file_directory+"farmer_quadratic_trivial_bundling_ipopt.baseline", filter=filter_time_and_data_dirs) 
     408        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_trivial_bundling_ipopt.out",this_test_file_directory+"farmer_quadratic_trivial_bundling_ipopt.baseline", filter=filter_time_and_data_dirs, tolerance=1e-4) 
    409409 
    410410    @unittest.skipIf(not cplex_available, "The 'cplex' executable is not available") 
     
    976976 
    977977        if os.sys.platform == "darwin": 
    978            self.assertFileEqualsBaseline(this_test_file_directory+"farmer_ef_with_solve_ipopt.out",this_test_file_directory+"farmer_ef_with_solve_ipopt_darwin.baseline", filter=filter_time_and_data_dirs)                 
     978           self.assertFileEqualsBaseline(this_test_file_directory+"farmer_ef_with_solve_ipopt.out",this_test_file_directory+"farmer_ef_with_solve_ipopt_darwin.baseline", filter=filter_time_and_data_dirs, tolerance=1e-4)                 
    979979        else: 
    980            self.assertFileEqualsBaseline(this_test_file_directory+"farmer_ef_with_solve_ipopt.out",this_test_file_directory+"farmer_ef_with_solve_ipopt.baseline", filter=filter_time_and_data_dirs)                 
     980           self.assertFileEqualsBaseline(this_test_file_directory+"farmer_ef_with_solve_ipopt.out",this_test_file_directory+"farmer_ef_with_solve_ipopt.baseline", filter=filter_time_and_data_dirs, tolerance=1e-4)                 
    981981 
    982982    def test_hydro_ef(self): 
     
    11771177        os.system(argstring) 
    11781178        self.cleanup() 
    1179         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_ipopt_with_pyro.out",this_test_file_directory+"farmer_quadratic_ipopt_with_pyro.baseline", filter=filter_pyro) 
     1179        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_ipopt_with_pyro.out",this_test_file_directory+"farmer_quadratic_ipopt_with_pyro.baseline", filter=filter_pyro, tolerance=1e-4) 
    11801180 
    11811181    @unittest.skipIf(not ipopt_available or not mpirun_available, "Either the 'ipopt' executable is not available or the 'mpirun' executable is not available") 
     
    11891189        os.system(argstring) 
    11901190        self.cleanup() 
    1191         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_ipopt_with_phpyro.out",this_test_file_directory+"farmer_quadratic_ipopt_with_phpyro.baseline", filter=filter_pyro) 
     1191        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_ipopt_with_phpyro.out",this_test_file_directory+"farmer_quadratic_ipopt_with_phpyro.baseline", filter=filter_pyro, tolerance=1e-4) 
    11921192 
    11931193    @unittest.skipIf(not ipopt_available or not mpirun_available, "Either the 'ipopt' executable is not available or the 'mpirun' executable is not available") 
     
    12011201        os.system(argstring) 
    12021202        self.cleanup() 
    1203         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_ipopt_with_phpyro.out",this_test_file_directory+"farmer_linearized_ipopt_with_phpyro.baseline", filter=filter_pyro) 
     1203        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_ipopt_with_phpyro.out",this_test_file_directory+"farmer_linearized_ipopt_with_phpyro.baseline", filter=filter_pyro, tolerance=1e-4) 
    12041204 
    12051205    @unittest.skipIf(not ipopt_available or not mpirun_available, "Either the 'ipopt' executable is not available or the 'mpirun' executable is not available") 
     
    12251225        os.system(argstring) 
    12261226        self.cleanup() 
    1227         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_bundling_ipopt_with_phpyro.out",this_test_file_directory+"farmer_quadratic_bundling_ipopt_with_phpyro.baseline", filter=filter_pyro) 
     1227        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_bundling_ipopt_with_phpyro.out",this_test_file_directory+"farmer_quadratic_bundling_ipopt_with_phpyro.baseline", filter=filter_pyro, tolerance=1e-4) 
    12281228 
    12291229    @unittest.skipIf(not cplex_available or not mpirun_available, "Either the 'cplex' executable is not available or the 'mpirun' executable is not available") 
     
    13211321        os.system(argstring) 
    13221322        self.cleanup() 
    1323         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_async_ipopt_with_pyro.out",this_test_file_directory+"farmer_quadratic_async_ipopt_with_pyro.baseline", filter=filter_pyro) 
     1323        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_quadratic_async_ipopt_with_pyro.out",this_test_file_directory+"farmer_quadratic_async_ipopt_with_pyro.baseline", filter=filter_pyro, tolerance=1e-4) 
    13241324 
    13251325    # async PH with one pyro solver server should yield the same behavior as serial PH. 
     
    13601360        os.system(argstring) 
    13611361        self.cleanup() 
    1362         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_async_ipopt_with_pyro.out",this_test_file_directory+"farmer_linearized_async_ipopt_with_pyro.baseline", filter=filter_pyro) 
     1362        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_linearized_async_ipopt_with_pyro.out",this_test_file_directory+"farmer_linearized_async_ipopt_with_pyro.baseline", filter=filter_pyro, tolerances=1e-4) 
    13631363 
    13641364    @unittest.skipIf(not cplex_available or not mpirun_available, "Either the 'cplex' executable is not available or the 'mpirun' executable is not available") 
     
    13721372        os.system(argstring) 
    13731373        self.cleanup() 
    1374         self.assertFileEqualsBaseline(this_test_file_directory+"farmer_with_integers_linearized_cplex_with_phpyro.out",this_test_file_directory+"farmer_with_integers_linearized_cplex_with_phpyro.baseline", filter=filter_pyro)         
     1374        self.assertFileEqualsBaseline(this_test_file_directory+"farmer_with_integers_linearized_cplex_with_phpyro.out",this_test_file_directory+"farmer_with_integers_linearized_cplex_with_phpyro.baseline", filter=filter_pyro, tolerances=1e-4)         
    13751375 
    13761376    # the primary objective of this test is to validate the bare minimum level of functionality on the PH solver server 
Note: See TracChangeset for help on using the changeset viewer.