pwrs.corex.types#

Shared type vocabulary for the MATPOWER-compatible core.

The MATLAB interface accepts many array-like values and dynamic structs. The aliases in this module describe the normalized values used inside the Python implementation, while the public compatibility functions may still accept npt.ArrayLike or mapping values and normalize them at their boundary.

class pwrs.corex.types.SparseMatrix(*args, **kwargs)[source]#

Bases: Protocol

Typed subset of the SciPy sparse matrix API used by core.

SciPy 1.15 does not ship complete type information for sparse matrices. Keeping this protocol local prevents that missing information from turning every downstream matrix expression into Any.

class pwrs.corex.types.BasicCaseData[source]#

Bases: TypedDict

Required fields available on an internal MATPOWER case mapping.

class pwrs.corex.types.CaseData[source]#

Bases: BasicCaseData

Optional fields commonly added during MATPOWER processing.

class pwrs.corex.types.RequiredResultFields[source]#

Bases: BasicCaseData

Fields present on every completed PF/OPF result.

class pwrs.corex.types.InternalResultData[source]#

Bases: RequiredResultFields

Mutable result builder used before public result normalization.

class pwrs.corex.types.EventData[source]#

Bases: TypedDict

Dynamic event record used by CPF event detection and callbacks.

class pwrs.corex.types.DoneData[source]#

Bases: TypedDict