Skip to content

PFSolver: exclude local shunt from PV/VD bus P/Q reporting - #590

Draft
leonardocarreras wants to merge 1 commit into
sogno-platform:masterfrom
leonardocarreras:fix/pf-shunt-pv-vd-reporting
Draft

PFSolver: exclude local shunt from PV/VD bus P/Q reporting#590
leonardocarreras wants to merge 1 commit into
sogno-platform:masterfrom
leonardocarreras:fix/pf-shunt-pv-vd-reporting

Conversation

@leonardocarreras

Copy link
Copy Markdown
Contributor

calculatePAndQInjectionPQBuses already excludes a bus's own shunt when reporting net nodal injection (flow to the rest of the network, matching the Pgen - Pd - Gs*Vm^2 convention). The PV and VD reporting paths (calculateQAtPVBuses, calculatePAndQAtSlackBus) did not, so a PV or VD bus with a nonzero shunt reported an injection that still included the shunt's own local draw.

@leonardocarreras leonardocarreras self-assigned this Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.36%. Comparing base (5780c9f) to head (55ba24b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #590      +/-   ##
==========================================
+ Coverage   72.14%   72.36%   +0.22%     
==========================================
  Files         491      491              
  Lines       31623    31633      +10     
  Branches    16950    16960      +10     
==========================================
+ Hits        22815    22892      +77     
+ Misses       8722     8670      -52     
+ Partials       86       71      -15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Leonardo Carreras <leonardo.carreras@eonerc.rwth-aachen.de>
@leonardocarreras
leonardocarreras force-pushed the fix/pf-shunt-pv-vd-reporting branch from a1aa9cc to 55ba24b Compare July 23, 2026 20:47

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DPsim LLM review

TL;DR: One real issue stands out: the new shunt reads in the PV/VD reporting paths need scheduler dependencies to avoid stale attribute values under parallel execution; the rest are low-value style/process nits or documentation/logging suggestions, and the equation/stamping intent otherwise matches the PR. No other correctness or safety problems were confirmed.

Found 2 high, 5 medium, 4 low (0 anchored to lines below).

🔵 Optional / low-confidence (11)
  • Missing dependency declaration for shunt parameters read in calculatePAndQAtSlackBus [high · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:484
  • Missing dependency declaration for shunt parameters read in calculateQAtPVBuses [high · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:526
  • Add debug-level logging for shunt exclusion in calculatePAndQAtSlackBus [medium · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:484
  • Add debug-level logging for shunt exclusion in calculateQAtPVBuses [medium · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:526
  • Add PFSolverPowerPolar shunt exclusion behavior to documentation [medium · 35% confidence · unconfirmed] in docs/hugo/content/en/docs/Models/PFSolver.md
  • Add missing SPDX header to new comment block [medium · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:484
  • Add missing SPDX header to new comment block [medium · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:526
  • Use const auto for dereferenced shunt parameters [low · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:488
  • Use const auto for dereferenced shunt parameters [low · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:530
  • Clarify comment for shunt exclusion in calculatePAndQAtSlackBus [low · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:484
  • Clarify comment for shunt exclusion in calculateQAtPVBuses [low · 35% confidence · unconfirmed] in dpsim/src/PFSolverPowerPolar.cpp:526
How this review was produced

13 specialized finder passes raised 11 findings over the diff and the full changed sources. After de-duplication, 11 were re-checked against the current file and the base-class / interface headers it inherits (code as truth), escalating survivors to a stronger model: 0 refuted as unsupported, 11 kept (11 tentative).

Automated, non-blocking review. May be wrong. Models: find mistral-small-4-119b-2603, gpt-oss-120b → verify gpt-5.4-mini → final gpt-5.5.

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.

1 participant