Package pypower :: Module loadcase
[hide private]
[frames] | no frames]

Module loadcase

source code

Loads a PYPOWER case dictionary.

Functions [hide private]
 
loadcase(casefile, return_as_obj=True, expect_gencost=True, expect_areas=True)
Returns the individual data matrices or an dict containing them as values.
source code
 
ppc_1to2(gen, branch) source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

loadcase(casefile, return_as_obj=True, expect_gencost=True, expect_areas=True)

source code 

Returns the individual data matrices or an dict containing them as values.

Here casefile is either a dict containing the keys baseMVA, bus, gen, branch, areas, gencost, or a string containing the name of the file. If casefile contains the extension '.mat' or '.py', then the explicit file is searched. If casefile containts no extension, then loadcase looks for a '.mat' file first, then for a '.py' file. If the file does not exist or doesn't define all matrices, the function returns an exit code as follows:

  1. all variables successfully defined
  2. input argument is not a string or dict
  3. specified extension-less file name does not exist
  4. specified .mat file does not exist
  5. specified .py file does not exist
  6. specified file fails to define all matrices or contains syntax error

If the input data is not a dict containing a 'version' key, it is assumed to be a PYPOWER case file in version 1 format, and will be converted to version 2 format.

Authors:
Carlos E. Murillo-Sanchez (PSERC Cornell & Universidad Autonoma de Manizales), Ray Zimmerman (PSERC Cornell), Richard Lincoln