pwrs.core.e2i_data#

pwrs.core.e2i_data.e2i_data(mpc, val, ordering, dim=1)[source]#

Reorder arbitrary data from external to internal indexing.

Uses the ordering metadata stored by ext2int to reorder a value along a specified dimension according to a MATPOWER ordering descriptor such as 'bus', 'gen', or a composite ordering list.

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

  • val (Any) – Data to reorder.

  • ordering (str or sequence) – MATPOWER ordering descriptor.

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

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

Returns:

Reordered value in internal ordering.

Return type:

Any