Skip to content

fix(pandapower): make N-1 outcome reporting explicit - #9

Open
BurhanAbdullah wants to merge 1 commit into
Power-Agent:mainfrom
BurhanAbdullah:fix/pandapower-contingency-reporting
Open

BurhanAbdullah wants to merge 1 commit into
Power-Agent:mainfrom
BurhanAbdullah:fix/pandapower-contingency-reporting

Conversation

@BurhanAbdullah

Copy link
Copy Markdown
Contributor

Summary

Improve the pandapower N-1 contingency workflow so failed and diverged contingency runs are reported explicitly instead of being treated as secure or silently omitted.

Changes

  • Explicitly distinguish converged, failed, and diverged contingency runs.
  • Require accounting for every requested outage before declaring the N-1 study complete.
  • Report voltage violations, line overloads, and transformer overloads separately.
  • Add aggregate counts for total, converged, failed, diverged, and critical contingencies.
  • Update the worked N-1 example to reflect the improved reporting workflow.
  • Distinguish contingency convergence failures from normal electrical violations in the escalation guidance.

Why

A contingency study should not be considered complete merely because some outage simulations returned results. A failed or diverged contingency is itself an important study outcome and must remain visible to the user.

This change makes the pandapower skill more reliable for agent-driven power-system studies and prevents partial N-1 results from being interpreted as an all-clear.

Scope

This PR only updates the existing pandapower skill documentation and worked example. It does not change the underlying pandapower analysis implementation or add dependencies.

Validation

  • Branch is up to date with Power-Agent/PowerSkills:main.
  • Only the pandapower skill and its worked examples are modified.
  • The example uses standard pandapower APIs and preserves the existing case14 workflow.

@qian-harvard

Copy link
Copy Markdown
Contributor

Review of ed6709a: please preserve the base-case convergence-failure escalation before merging.

In powerskills-tool/skills/pandapower/SKILL.md:40, the new contingency-only trigger replaces the existing run_power_flow failure trigger. This removes the explicit route to convergence-failure-mitigation when the base-case solve fails, even though a credible base case is required before running contingencies. Please keep both triggers, either in separate rows or with wording such as “The base-case or a contingency power flow fails or diverges.”

Validation: the documented case14 example ran with pandapower 3.5.6: 15 attempted, 15 converged, 0 failed, 0 diverged, and 15 critical. The changes also merge cleanly with main’s recent copy.deepcopy repair.

Nonblocking test improvement: tests/test_n1_example.py:19–24 checks accounting and result shape but still passes if every contingency solve raises after the base solve succeeds. Please consider adding a known successful outage and deliberate failure/divergence cases so the test catches that regression.

@BurhanAbdullah
BurhanAbdullah force-pushed the fix/pandapower-contingency-reporting branch from d6af6c2 to 2dbbfa2 Compare October 25, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants