Skip to content

Ambiguity and mandatory requirement of 'max_loading_percent' in N-1 contingency analysis #2684

@lardillierp

Description

@lardillierp

Problem Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions