Skip to content

Move operation models to PowerOperationsModels#100

Closed
luke-kiernan wants to merge 2 commits into
mainfrom
lk/move-operation-to-pom
Closed

Move operation models to PowerOperationsModels#100
luke-kiernan wants to merge 2 commits into
mainfrom
lk/move-operation-to-pom

Conversation

@luke-kiernan
Copy link
Copy Markdown
Collaborator

Summary

  • Slim IOM to abstract operation-model interface; move DecisionModel/EmulationModel, their stores, OptimizationProblemOutputs, and related operation utilities to PowerOperationsModels.
  • Parameterize OperationModel{T <: OperationProblem} and add OperationProblem as a common supertype for DecisionProblem/EmulationProblem; collapse _get_model_type to one method.
  • Trim operation_model_interface.jl to abstract-only accessors; POM owns the store-reading and numerical-bounds helpers.

Pairs with POM PR (to follow). POM needs to land first locally; once merged, update POM's [sources] entry to point at the merged IOM rev.

Test plan

  • IOM unit tests: 1035/1035 pass (`Pkg.test()` / TestEnv).
  • POM unit tests (against this branch dev-linked): targeted files 3367/3367 pass; full suite 13109/13110 pass (1 broken pre-existing).
  • Re-run POM full suite once after final formatting before merging the paired POM PR.

🤖 Generated with Claude Code

IOM keeps only abstract types and the operation-model interface; concrete
DecisionModel/EmulationModel, their stores, OptimizationProblemOutputs,
and related operation utilities now live in POM.

- Parameterize OperationModel{T <: OperationProblem}; collapse _get_model_type
- Move src/operation/{decision,emulation}_model.jl + stores, problem_outputs.jl,
  time_series_interface.jl, store_common.jl, initial_conditions_update_in_memory_store.jl,
  optimization_debugging.jl, model_numerical_analysis_utils.jl
- Move src/core/optimization_problem_outputs{,_export}.jl
- Slim operation_model_interface.jl: keep abstract-only accessors, hand POM the
  store-reading and numerical-bounds helpers
- Drop dead test files and POM-glue mocks from test/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Performance Results
Main


This branch


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors InfrastructureOptimizationModels (IOM) to retain only the abstract operation-model interface and shared key/container infrastructure, while moving concrete operation-model implementations (DecisionModel/EmulationModel), model stores, OptimizationProblemOutputs, and related utilities into PowerOperationsModels (POM).

Changes:

  • Removed concrete operation model types/stores, output reading/exporting, numerical-bound/debug utilities, and time-series helpers from IOM (to be owned by POM).
  • Introduced OperationProblem as a common supertype and parameterized OperationModel{T <: OperationProblem}; added get_problem_type helper.
  • Updated test harness and pretty-printing to reflect the new ownership boundaries.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/test_utils/run_simulation.jl Removed simulation helper (operation models moved out).
test/test_utils/common_operation_model.jl Removed IC serialization test helper (moved out with models/stores).
test/test_optimization_outputs.jl Removed OptimizationProblemOutputs tests (now expected in POM).
test/test_model_store.jl Removed placeholder model-store tests.
test/test_model_emulation.jl Removed emulation model tests (now expected in POM).
test/InfrastructureOptimizationModelsTests.jl Stops including moved tests; updates notes about test location/ownership.
src/utils/print_pt_v3.jl Switches model type display to get_problem_type; removes show methods for moved concrete types.
src/operation/time_series_interface.jl Removed time-series cache accessors for Decision/Emulation models.
src/operation/store_common.jl Removed output-writing/export plumbing tied to concrete stores.
src/operation/problem_outputs.jl Removed constructors for OptimizationProblemOutputs from Decision/Emulation models.
src/operation/optimization_debugging.jl Removed MOI index/debug helpers tied to concrete models.
src/operation/operation_model_interface.jl Trims to abstract-only getters/setters; removes store-reading/output helper methods.
src/operation/model_numerical_analysis_utils.jl Removed numerical-bound analysis helpers (moved to POM).
src/operation/initial_conditions_update_in_memory_store.jl Removed IC update-from-store stub (moved to POM).
src/operation/emulation_model.jl Removed EmulationModel implementation (moved to POM).
src/operation/emulation_model_store.jl Removed EmulationModelStore implementation (moved to POM).
src/operation/decision_model.jl Removed DecisionModel implementation (moved to POM).
src/operation/decision_model_store.jl Removed DecisionModelStore implementation (moved to POM).
src/core/optimization_problem_outputs.jl Removed OptimizationProblemOutputs type + readers/export/serialization (moved to POM).
src/core/optimization_problem_outputs_export.jl Removed export-configuration type (moved to POM).
src/core/operation_model_abstract_types.jl Adds OperationProblem and parameterizes OperationModel; defines get_problem_type.
src/InfrastructureOptimizationModels.jl Updates exports/includes to match new IOM/POM split; removes includes for moved code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/operation/operation_model_interface.jl Outdated
Comment thread src/InfrastructureOptimizationModels.jl
Comment thread src/utils/print_pt_v3.jl
- Remove stale read_optimizer_stats export (function moved to POM).
- Correct misleading comment in operation_model_interface.jl: instantiate_network_model!(::OperationModel) legitimately stays in IOM (interface-accessor entry point that dispatches to POM-owned concrete methods).
- Fix _get_model_type → get_problem_type in print_pt_v3.jl emulator-row branch.
- Delete unused Simulation/SimulationOutputs/SimulationProblemOutputs abstract type placeholders and their orphaned show methods (PSI types, never used here).
- Bump PowerNetworkMatrices compat to ^0.20 and drop self dev-link from test/Project.toml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@luke-kiernan luke-kiernan requested a review from acostarelli May 13, 2026 21:01
@acostarelli
Copy link
Copy Markdown
Member

Why is this stuff moving to POM?

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 file should stay here in IOM

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 also should stay here

@jd-lara
Copy link
Copy Markdown
Member

jd-lara commented May 14, 2026

@luke-kiernan this PR needs to be more carefully crafted

@luke-kiernan
Copy link
Copy Markdown
Collaborator Author

this PR needs to be more carefully crafted

Hmm. My basic question: why is this operation stuff here in the first place? Organizationally, it'd fit better in POM. Putting it there minimizes the number of stubs, so we can write tests without extensive duck-typing.

Once I started moving a couple things to POM, I found myself with structs and functions defined in IOM that are only used in POM. Which lead me to move more things to POM.

[model_numerical_analysis_utils.jl and optimization_problem_outputs.jl] should stay here [in IOM]

Just those two? If so, why just those two? Yeah the underlying organizational philosophy here is completely lost on me.

@jd-lara
Copy link
Copy Markdown
Member

jd-lara commented May 18, 2026

@luke-kiernan we will come back to this once #97 is merged

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.

4 participants