Move EM/DM to IOM#160
Closed
acostarelli wants to merge 1 commit into
Closed
Conversation
The domain-neutral build/solve/run lifecycle now lives in IOM. POM keeps only the power-specific extension-point implementations: - Delete the moved methods (build!/solve!/run!/build_model!/build_pre_step!/ reset!/handle_initial_conditions!/build_if_not_already_built!/execute_emulation!/ solve_and_write_initial_conditions!). Re-export build!/solve!/run! from IOM and import build_problem!/build_initial_conditions! to extend the IOM generics. - Collapse the problem-type hierarchy to a single linear chain AbstractPowerOperationProblem -> GenericPowerOperationProblem -> DefaultPowerOperationProblem. The decision<->emulation distinction is the wrapper's job (DecisionModel/EmulationModel), so the *Decision*/*Emulation* problem types are removed; constructors, validate_*, exports, and test mocks are rebound accordingly. - Drop the duplicated timer constants; import BUILD_PROBLEMS_TIMER from IOM so build_problem! timings aggregate into IOM's printout. Point [sources] at the IOM ac/move-op-models branch for co-development (revert to main before merge). Refresh the stale IOM/POM split notes in .claude/CLAUDE.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors PowerOperationsModels (POM) to rely on InfrastructureOptimizationModels (IOM) for the domain-neutral operation-model lifecycle, while POM retains only power-specific extension-point implementations and a simplified power problem-type taxonomy.
Changes:
- Removes POM-owned lifecycle methods and re-exports
build!/solve!/run!from IOM; importsbuild_problem!andbuild_initial_conditions!as POM’s IOM extension points. - Collapses the power problem-type hierarchy into a single linear chain (
AbstractPowerOperationProblem → GenericPowerOperationProblem → DefaultPowerOperationProblem) and updates constructors/tests accordingly. - Drops duplicated timer constants in POM and imports
BUILD_PROBLEMS_TIMERfrom IOM so build timings aggregate under IOM’s timer output.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/PowerOperationsModels.jl |
Imports/re-exports IOM lifecycle functions; updates exports and imports BUILD_PROBLEMS_TIMER. |
src/core/problem_types.jl |
Simplifies the power problem-type hierarchy to a single linear chain. |
src/core/definitions.jl |
Removes locally defined timer constants (now owned by IOM). |
src/operation/decision_model.jl |
Updates defaulting constructors and consolidates validate_template dispatch for template-driven problems. |
src/operation/emulation_model.jl |
Updates default problem type and validate_time_series! dispatch to the new generic problem type. |
src/initial_conditions/initialization.jl |
Removes solve_and_write_initial_conditions! (lifecycle-owned behavior moved to IOM). |
test/test_utils/mock_operation_models.jl |
Rebinds mock problem types to GenericPowerOperationProblem. |
test/test_utils.jl |
Updates progress meter test to target IOM’s implementation. |
test/test_device_thermal_generation_constructors.jl |
Updates test constructors to use GenericPowerOperationProblem. |
Project.toml |
Pins InfrastructureOptimizationModels to the ac/move-op-models branch for co-development. |
test/Project.toml |
Pins InfrastructureOptimizationModels to the ac/move-op-models branch for tests. |
.claude/CLAUDE.md |
Updates repository split notes to reflect lifecycle ownership in IOM and the collapsed problem chain. |
Comments suppressed due to low confidence (1)
test/Project.toml:41
- The test environment also pins
InfrastructureOptimizationModelsto theac/move-op-modelsbranch. If this PR is intended to be mergeable on its own, please revert this tomain(or a tag/commit SHA) before merge so tests run against a stable dependency ref.
[sources]
InfrastructureOptimizationModels = {rev = "ac/move-op-models", url = "https://github.com/Sienna-Platform/InfrastructureOptimizationModels.jl"}
InfrastructureSystems = {rev = "IS4", url = "https://github.com/Sienna-Platform/InfrastructureSystems.jl"}
PowerSystems = {rev = "psy6", url = "https://github.com/Sienna-Platform/PowerSystems.jl"}
PowerFlows = {rev = "psy6", url = "https://github.com/Sienna-Platform/PowerFlows.jl"}
PowerNetworkMatrices = {rev = "psy6", url = "https://github.com/Sienna-Platform/PowerNetworkMatrices.jl"}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
21
to
25
| throw( | ||
| IS.ArgumentError( | ||
| "GenericPowerDecisionProblem subtypes require a template. Use DecisionModel subtyping instead.", | ||
| "GenericPowerOperationProblem subtypes require a template. Use DecisionModel subtyping instead.", | ||
| ), | ||
| ) |
Comment on lines
30
to
34
| if counts.static_time_series_count < 1 | ||
| error( | ||
| "The system does not contain Static Time Series data. A EmulationModel can't be built.", | ||
| ) | ||
| end |
acostarelli
commented
Jun 29, 2026
|
|
||
| """ | ||
| Supertype for rolling-horizon (emulation) operation problems solved by `EmulationModel`. | ||
| Default concrete template-driven operation problem. The `M` used when a |
Member
Author
There was a problem hiding this comment.
This comment is confusing.
|
|
||
| """ | ||
| Supertype for single-period (decision) operation problems solved by `DecisionModel`. | ||
| Operation problems whose build/validate behavior is fully driven by the |
Member
Author
There was a problem hiding this comment.
Don't like this docstring
This was
linked to
issues
Jul 1, 2026
Member
Author
|
See discussion at Sienna-Platform/InfrastructureOptimizationModels.jl#133 |
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.
I also combined E/D Problems into one
I'm open to disagreement about this. I don't really know what other infrastructure systems need, but this code seems non-specific to power.