pwrs.corex.interop#

pwrs.corex.interop.from_matpower_mat(filename, name='mpc')[source]#

Load a MATPOWER case from a .mat file.

Parameters:
  • filename (str) – Path to the .mat file containing the MATPOWER case struct.

  • name (str, optional) – Name of the variable in the .mat file that contains the case struct. Defaults to ‘mpc’.

Returns:

The loaded case struct as a MatpowerCase instance.

Return type:

MatpowerCase

pwrs.corex.interop.from_pypower(ppc)[source]#

Convert and validate a PYPOWER-style case dictionary.

Parameters:

ppc (Mapping[str, Any])

Return type:

MatpowerCase

pwrs.corex.interop.to_matpower_mat(fname, mpc, name='mpc')[source]#

Save a MATPOWER case struct to a MAT-file.

Parameters:
  • fname (str) – Output MAT-file path.

  • mpc (dict) – MATPOWER case struct to save.

  • name (str)

Return type:

Path

pwrs.corex.interop.to_pypower(case)[source]#

Return an independent PYPOWER-style case dictionary.

Parameters:

case (MatpowerCase | Mapping[str, Any])

Return type:

dict[str, Any]