Skip to content

update hydro and storage to IOM helpers#97

Merged
jd-lara merged 4 commits intomainfrom
lk/hydro-storage-update
Apr 27, 2026
Merged

update hydro and storage to IOM helpers#97
jd-lara merged 4 commits intomainfrom
lk/hydro-storage-update

Conversation

@luke-kiernan
Copy link
Copy Markdown
Collaborator

@luke-kiernan luke-kiernan commented Apr 23, 2026

Update hydro/storage to use the new IOM helpers. Requires IOM #88.

I plan to merge #77 (lk/mbc_iec_refactor into main) then this (lk/hydro-storage-update into main). But I'm still waiting for approval on the first.

edit: #77 is merged, so this is up next.

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

Updates hydro and energy storage device models to align with the newer InfrastructureOptimizationModels (IOM) helper APIs, primarily by switching to the add_to_objective_function! interface and delegating common bound/cost logic to IOM utilities.

Changes:

  • Replace legacy objective_function! calls with add_to_objective_function! in hydro/storage constructors and implement/rename corresponding methods.
  • Refactor hydro proportional-cost and pump reservation/commitment bound constraints to use IOM helpers (add_cost_term_invariant!, add_*_bound_range_constraints!), reducing duplicated JuMP constraint/objective plumbing.
  • Extend initial-condition updating to support InitialReservoirVolume via the generic IC-to-variable mapping.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/static_injector_models/thermal_generation.jl Updates IOM semicontinuous bound constraint specialization to support a meta suffix (needed by newer helper call patterns).
src/static_injector_models/hydrogeneration_constructor.jl Switches hydro constructors to call add_to_objective_function! instead of objective_function!.
src/static_injector_models/hydro_generation.jl Refactors hydro constraint dispatch signatures, cost addition, and pump reservation/commitment bound constraints to use IOM helpers.
src/initial_conditions/update_initial_conditions.jl Adds IC mapping for InitialReservoirVolumeHydroReservoirVolumeVariable.
src/energy_storage_models/storage_models.jl Renames objective hooks to add_to_objective_function! and refactors final-timestep proportional slack penalties via IOM.add_cost_term_invariant!.
src/energy_storage_models/storage_constructor.jl Switches storage constructors to call add_to_objective_function!.

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

@luke-kiernan luke-kiernan changed the base branch from lk/mbc_iec_refactor to main April 24, 2026 15:44
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Performance Results

Version Precompile Time
Main 2.851927257
This Branch 2.85241369
Version Build Time
Main-Build Time Precompile 72.301698137
Main-Build Time Postcompile 1.317610854
This Branch-Build Time Precompile 69.477432262
This Branch-Build Time Postcompile 1.258738352
Version Solve Time
Main-Solve Time Precompile 368.845238199
Main-Solve Time Postcompile 339.415094057
This Branch-Solve Time Precompile 127.278066768
This Branch-Solve Time Postcompile 98.85913682

@luke-kiernan luke-kiernan marked this pull request as ready for review April 24, 2026 19:50
@luke-kiernan
Copy link
Copy Markdown
Collaborator Author

luke-kiernan commented Apr 24, 2026

Version Solve Time
Main-Solve Time Precompile 368.845238199
Main-Solve Time Postcompile 339.415094057
This Branch-Solve Time Precompile 127.278066768
This Branch-Solve Time Postcompile 98.85913682

Wait why did the solve time just drop by a factor of 3...

edit: apparently it's just high variance. Ran it locally and got similar performance between the two.

@jd-lara jd-lara merged commit 99f77a2 into main Apr 27, 2026
5 of 6 checks passed
acostarelli pushed a commit that referenced this pull request Apr 29, 2026
Adds the bilinear (flow*head) hydro dispatch formulation and folds in
adjacent refactors merged through this branch:
  - Hydro and storage updates to IOM helpers (#97)
  - POM-to-IOM type-dispatch API migration
  - MarketBidCost / ImportExportCost static/TS split + IEC refactor
  - Shiftable-load interval indexing and validation fixes
  - HDF system serialization (#75)
  - Pin GitHub revisions; bridge IOM system-query stubs to PSY public API

Co-Authored-By: Luke Kiernan <86331877+luke-kiernan@users.noreply.github.com>
Co-Authored-By: Rodrigo Henríquez-Auba <rodrigo.henriquezauba@nrel.gov>
Co-Authored-By: Jose Daniel Lara <jdlara@berkeley.edu>
Co-Authored-By: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@luke-kiernan luke-kiernan deleted the lk/hydro-storage-update branch April 30, 2026 15:34
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.

3 participants