Package pypower :: Package t :: Module test_pypower
[hide private]
[frames] | no frames]

Source Code for Module pypower.t.test_pypower

  1  # Copyright (C) 2004-2011 Power System Engineering Research Center (PSERC) 
  2  # Copyright (C) 2011 Richard Lincoln 
  3  # 
  4  # PYPOWER is free software: you can redistribute it and/or modify 
  5  # it under the terms of the GNU General Public License as published 
  6  # by the Free Software Foundation, either version 3 of the License, 
  7  # or (at your option) any later version. 
  8  # 
  9  # PYPOWER is distributed in the hope that it will be useful, 
 10  # but WITHOUT ANY WARRANTY], without even the implied warranty of 
 11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 12  # GNU General Public License for more details. 
 13  # 
 14  # You should have received a copy of the GNU General Public License 
 15  # along with PYPOWER. If not, see <http://www.gnu.org/licenses/>. 
 16   
 17  """Run all PYPOWER tests. 
 18  """ 
 19   
 20  from pypower.t.t_run_tests import t_run_tests 
 21   
 22   
23 -def test_pypower(verbose=False):
24 """Run all PYPOWER tests. 25 26 Prints the details of the individual tests if verbose is true. 27 28 @author: Ray Zimmerman (PSERC Cornell) 29 @author: Richard Lincoln 30 """ 31 tests = [] 32 33 ## PYPOWER base test 34 tests.append('t_loadcase') 35 tests.append('t_ext2int2ext') 36 tests.append('t_jacobian') 37 tests.append('t_hessian') 38 tests.append('t_totcost') 39 tests.append('t_modcost') 40 tests.append('t_hasPQcap') 41 42 tests.append('t_pips') 43 44 tests.append('t_qps_pypower') 45 tests.append('t_pf') 46 47 tests.append('t_opf_pips') 48 tests.append('t_opf_pips_sc') 49 50 # try: 51 # import pyipopt #@UnusedImport 52 # tests.append('t_opf_ipopt') 53 # tests.append('t_opf_dc_ipopt') 54 # except ImportError: 55 # pass 56 57 tests.append('t_opf_dc_pips') 58 tests.append('t_opf_dc_pips_sc') 59 60 # try: 61 # import mosek #@UnusedImport 62 # tests.append('t_opf_dc_mosek') 63 # except ImportError: 64 # pass 65 66 tests.append('t_opf_userfcns') 67 tests.append('t_runopf_w_res') 68 tests.append('t_makePTDF') 69 tests.append('t_makeLODF') 70 tests.append('t_total_load') 71 tests.append('t_scale_load') 72 73 # ## smartmarket tests 74 # tests.append('t_off2case') 75 # tests.append('t_auction_mips') 76 # tests.append('t_runmarket') 77 78 t_run_tests(tests, verbose)
79 80
81 -def test_pf(verbose=False):
82 tests = [] 83 84 tests.append('t_loadcase') 85 tests.append('t_ext2int2ext') 86 tests.append('t_jacobian') 87 tests.append('t_pf') 88 89 return t_run_tests(tests, verbose)
90 91
92 -def test_opf(verbose=False, *others):
93 tests = [] 94 95 tests.append('t_loadcase') 96 tests.append('t_ext2int2ext') 97 tests.append('t_hessian') 98 tests.append('t_totcost') 99 tests.append('t_modcost') 100 tests.append('t_hasPQcap') 101 102 tests.append('t_qps_pypower') 103 104 tests.append('t_opf_dc_pips') 105 tests.append('t_opf_dc_pips_sc') 106 107 tests.append('t_pips') 108 109 tests.append('t_opf_pips') 110 tests.append('t_opf_pips_sc') 111 112 tests.append('t_runopf_w_res') 113 114 tests.append('t_makePTDF') 115 tests.append('t_makeLODF') 116 tests.append('t_total_load') 117 tests.append('t_scale_load') 118 119 tests.extend(others) 120 121 return t_run_tests(tests, verbose)
122 123 124 if __name__ == '__main__': 125 test_pypower(verbose=True) 126