pwrs.core.e2i_field#

pwrs.core.e2i_field.e2i_field(mpc, field, ordering, dim=1)[source]#

Convert a case struct field from external to internal ordering.

Saves the current external-order value for field under mpc['order']['ext'] and replaces the live field value with the internal-order version produced by e2i_data.

Parameters:
  • mpc (dict) – MATPOWER case struct in internal order, with order metadata.

  • field (str or sequence of str) – Field name or nested field path to convert.

  • ordering (str or sequence) – MATPOWER ordering descriptor used for the conversion.

  • dim (int, optional) – One-based dimension along which to reorder.

  • nargout (int, optional) – MATLAB compatibility flag.

Returns:

Updated MATPOWER case struct with the converted field.

Return type:

dict