You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using run_contingency, I encountered two issues related to the handling of the max_loading_percent attribute:
1. Mandatory presence of max_loading_percent
If the elements in the network (e.g. net.line) do not have a max_loading_percent column, the N-1 analysis fails with a KeyError.
In practice, this attribute should not always be mandatory: for N-0 runs, the calculation works fine without it, but for N-1 it breaks because _update_contingency_results tries to access it unconditionally.
This makes it impossible to run contingency analysis on networks that do not define this attribute.
2. Ambiguity of the attribute’s meaning
The name max_loading_percent is used in two different contexts:
as a threshold: the maximum allowed loading beyond which an element is considered overloaded,
as a result: the highest observed loading of an element during N-1 scenarios.
This dual use can easily cause confusion, since the same name refers to both an input parameter and a computed result.