Repository navigation
Port G-1 reserves - #331
Merged
Merged
Conversation
added 27 commits
September 28, 2026 14:04
…straint and slacks on flow
… slacks keys need to be reconsidered I think
…of reserves code; enumx
- consolidated expressions across area balance and ptdf - dropped type aliases - simplified template validation. i realize what i dont like is how template validation affects the program state, which is confusing. id rather just check for valid components when they are needed. - uuid -> outage_id - flatten tests for retest compatibility -
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved construction, export, validation, serialization, compatibility, and test issues remain.
Review effort: Lite
Findings: 5
Open (8)
Keep system and time-series artifact writing enabled · New Reject non-generator components in reserve outages · New Restore generic no-op service seeding overload · New Remove invalid argument from seed range expression call · New Fix deployment key destructuring in assertion · New Export the defined post-contingency deployment expression · New Handle missing branch models during outage validation · New Require requirement time series for ramp reserves · New
What changed in this PR
Ports G-1 security-constrained reserve formulations with post-contingency deployment, balance, flow constraints, validation, and tests.
Changes:
- Adds G-1 formulations, variables, expressions, and constraints.
- Integrates reserve construction and outage validation.
- Updates tests, exports, compatibility, and solve behavior.
| File | Description |
|---|---|
test/test_static_injection_security_constrained_models.jl |
Adds G-1 integration tests. |
src/services_models/services_constructor.jl |
Constructs G-1 reserve services. |
src/services_models/security_constrained_injectors.jl |
Implements contingency deployment and flow logic. |
src/services_models/reserves.jl |
Adds reserve time-series defaults. |
src/PowerOperationsModels.jl |
Registers and exports new APIs. |
src/operation/template_validation.jl |
Validates transformer outages. |
src/operation/decision_model.jl |
Changes system output handling. |
src/core/variables.jl |
Adds post-contingency variables. |
src/core/formulations.jl |
Defines G-1 formulations. |
src/core/expressions.jl |
Adds deployment expressions. |
src/core/constraints.jl |
Adds G-1 constraints. |
Project.toml |
Updates PowerFlows compatibility. |
.claude/pom_port_plan.md |
Removes the porting plan. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+234
to
+236
| # TODO: re-enable before merging, once PSY.to_file is fixed. | ||
| #!ispath(sys_dir) && | ||
| # PSY.to_file(sys, sys_dir; power_units = :component_base) |
Comment on lines
+67
to
+69
| for generator in | ||
| PSY.get_associated_components(sys, outage; component_type = PSY.Generator) | ||
| T = typeof(generator) |
Comment on lines
+44
to
+49
| function seed_reserve_range_expressions!( | ||
| container::OptimizationContainer, | ||
| sys::PSY.System, | ||
| model::ServiceModel{S, <:AbstractReservesFormulation}, | ||
| devices_template::DevicesModelContainer, | ||
| ) where {S <: PSY.AbstractReserve} |
Comment on lines
+61
to
+64
| _seed_range_expression!( | ||
| container, | ||
| sys, | ||
| get_expression_type_for_reserve(ActivePowerReserveVariable, device_type, S), |
| outaged = Set( | ||
| (typeof(g), PSY.get_name(g), uuid) for (uuid, o) in uuids for g in _outaged(sys, o) | ||
| ) | ||
| @test !any(((D, _, _, d, uuid, _),) -> (D, d, uuid) in outaged, keys(deployments)) |
Comment on lines
+537
to
+538
| model = get(branch_models, nameof(T), nothing) | ||
| _has_unsupported_phase(transformer, model) && throw( |
Comment on lines
+1124
to
+1128
| _is_procured( | ||
| model::ServiceModel{<:PSY.AbstractReserve, F}, | ||
| service::PSY.AbstractReserve, | ||
| ) where {F <: AbstractSecurityConstrainedReservesFormulation} = | ||
| _is_ramp_formulation(F) || _has_ts_requirement(model, service) |
|
Performance Results
|
Scope the security-constrained reserve formulations to
OnlineReserve{ReserveUp}. Remove the offline-reserve paths and the
use_slacks agreement check, which one service model type cannot reach.
Add a template validation gate for the supported networks, reserve
types, and contributor types. Gate post-contingency deployment on the
commitment status and the time-step availability. Support storage
contributors. Under AreaPTDF, carry the PTDF flow change over the AC
tie lines of each monitored interchange.
Restore Project.toml, decision_model.jl, template_validation.jl, and
pom_port_plan.md to main. Fix the undefined exports and the method
ambiguity that Aqua reported.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
jd-lara
approved these changes
Oct 12, 2026
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.


No description provided.