use the helpers to reduce reactive power#311
Open
jd-lara wants to merge 1 commit into
Open
Conversation
Comment on lines
+77
to
+78
| forces_keep = PSY.supports_active_power(c) || | ||
| (!reduce_reactive_power_injectors && PSY.supports_reactive_power(c)) |
Contributor
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
Suggested change
| forces_keep = PSY.supports_active_power(c) || | |
| (!reduce_reactive_power_injectors && PSY.supports_reactive_power(c)) | |
| forces_keep = | |
| PSY.supports_active_power(c) || | |
| (!reduce_reactive_power_injectors && PSY.supports_reactive_power(c)) |
| @test !(2 in reduced.irreducible_buses) # condenser bus is a reduction candidate | ||
| @test 2 in reduced.removed_buses # and is actually folded out of the chain | ||
|
|
||
| kept = PNM.get_reduction(adj, sys, DegreeTwoReduction(; reduce_reactive_power_injectors = false)) |
Contributor
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
Suggested change
| kept = PNM.get_reduction(adj, sys, DegreeTwoReduction(; reduce_reactive_power_injectors = false)) | |
| kept = PNM.get_reduction( | |
| adj, | |
| sys, | |
| DegreeTwoReduction(; reduce_reactive_power_injectors = false), | |
| ) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts degree-two network reduction so reactive-only injection hosts can be reduced by default while still allowing callers to keep them via reduce_reactive_power_injectors = false.
Changes:
- Updates system-derived irreducible bus selection to use PowerSystems active/reactive support traits.
- Wires the
DegreeTwoReductionoption throughAdjacencyMatrix.get_reduction. - Adds regression tests for a degree-2 bus hosting only a
SynchronousCondenser.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/reduction_helpers.jl |
Applies active/reactive trait checks when deriving irreducible buses. |
src/AdjacencyMatrix.jl |
Passes the reduction setting into the helper. |
src/degree_two_reduction.jl |
Documents the reactive-only injector behavior. |
test/test_degree_two_reactive_injectors.jl |
Adds targeted tests for reactive-only degree-2 reduction behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+77
to
+78
| forces_keep = PSY.supports_active_power(c) || | ||
| (!reduce_reactive_power_injectors && PSY.supports_reactive_power(c)) |
Contributor
Performance ResultsPrecompile Time
Execution Time
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improving the reduction code to enable the reduction injectors that only supply reactive power.
This PR requires Sienna-Platform/PowerSystems.jl#1645