Skip to content

area copperplate balance duals - #326

Open
acostarelli wants to merge 2 commits into
mainfrom
ac/area-duals
Open

acostarelli wants to merge 2 commits into
mainfrom
ac/area-duals

Conversation

@acostarelli

Copy link
Copy Markdown
Member

Closes #293

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Add the missing PSY.Area dual calculation method to prevent failures during dual output processing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Adds area-level copperplate balance dual registration for area-based network models.

Changes:

  • Registers area-keyed dual containers.
  • Adds regression tests for area balance and PTDF formulations.
File Description
test/​test_network_constructors.jl Tests area-level dual availability and outputs.
src/​network_models/​copperplate_model.jl Registers area-level dual containers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/network_models/copperplate_model.jl Outdated
time_steps = get_time_steps(container)
existing = get_constraint(container, CopperPlateBalanceConstraint(), PSY.Area)
area_names = axes(existing)[1]
add_dual_container!(container, CopperPlateBalanceConstraint, PSY.Area, area_names, time_steps)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It falls back to IOM I believe

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Performance Results

Version Precompile Time
Main 3.158930851
This Branch 3.200677688
Version Build Time
Main-Build Time Precompile 84.289043934
Main-Build Time Postcompile 1.018854192
This Branch-Build Time Precompile 84.382305357
This Branch-Build Time Postcompile 1.009152001
Version Solve Time
Main-Solve Time Precompile 122.589860971
Main-Solve Time Postcompile 91.016025059
This Branch-Solve Time Precompile 307.727583946
This Branch-Solve Time Postcompile 263.298392153

@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

sys::PSY.System,
model::NetworkModel{T},
) where {T <: Union{CopperPlateNetworkModel, AbstractPTDFNetworkModel}}
) where {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This triple union isn't great

This branch has not been deployed

No deployments
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.

Port PSI#1663 area balance fix

3 participants