Skip to content

Add hydro formulation with bilinear approximation#87

Open
acostarelli wants to merge 4 commits into
mainfrom
ac/hydro-bilinear
Open

Add hydro formulation with bilinear approximation#87
acostarelli wants to merge 4 commits into
mainfrom
ac/hydro-bilinear

Conversation

@acostarelli
Copy link
Copy Markdown
Member

@acostarelli acostarelli commented Apr 17, 2026

@acostarelli acostarelli changed the title Ac/hydro bilinear Add hydro formulation with bilinear approximation Apr 17, 2026
@acostarelli acostarelli requested a review from jd-lara April 21, 2026 21:46
@acostarelli acostarelli marked this pull request as ready for review April 23, 2026 20:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Performance Results

Version Precompile Time
Main 2.912028387
This Branch 2.883937754
Version Build Time
Main-Build Time Precompile 98.170735345
Main-Build Time Postcompile 16.43707951
This Branch-Build Time Precompile 101.284640553
This Branch-Build Time Postcompile 14.838361171
Version Solve Time
Main-Solve Time Precompile 401.119732777
Main-Solve Time Postcompile 370.228373033
This Branch-Solve Time Precompile 167.244569312
This Branch-Solve Time Postcompile 135.740765917

Copy link
Copy Markdown
Collaborator

@luke-kiernan luke-kiernan left a comment

Choose a reason for hiding this comment

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

More so than the below comment, I'd like to see one or two unit tests. IOM tests the formulation math, so you don't need to do that. The concern is more so: does the POM plumbing hand things to IOM correctly? E.g. spot check a couple constraints and coefficients for a simple case, to confirm that things are getting matched up as intended, that we're not missing a unit conversion somewhere

Comment on lines +1853 to +1856
(
min = get_variable_lower_bound(HydroTurbineFlowRateVariable, d, W),
max = get_variable_upper_bound(HydroTurbineFlowRateVariable, d, W),
) for _ in 1:length(reservoirs)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh, you're passing in the same bounds for all the reservoirs here. You could make that clearer via repeat.

It took me a bit of thought to work out the shapes: might be worth mentioning that we're assuming min/max bounds are time-independent here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do min/max bounds change over time in other cases?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Time-varying max_active_power is super common, e.g. for solar or wind. I can't find a spot where head height or outflow limits are time-varying, though.

Copy link
Copy Markdown
Collaborator

@luke-kiernan luke-kiernan left a comment

Choose a reason for hiding this comment

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

My other 2 cents (more of a nitpick): the commit situation is 10x more complex than the code merits...I'd be tempted to merge from a fresh branch with just 1 or 2 commits.

Comment thread test/test_device_hydro_constructors.jl Outdated
(hydro_vol_df[1, :value]) +
((total_inflow - total_outflow - total_spillage) * 3600 * 1e-9)

@test abs(calculated_vf - hydro_vol_df[end, :value]) <= 1e-4
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks like a good use case for approx. Might be worth commenting why 1e-4 is reasonable: presumably calculated_vf is signficiantly larger? Some magic numbers in calculate_vf too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I copied this test from the other Bilinear formulation tbh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with Luke here. I would replace the test by:
@test isapprox(calculated_vf, hydro_vol_df[end, :value], atol = tol

In the same sense, can you define tol = 1e-4 and a comment to why using 1e-4?

repeat(
[
(
min = get_variable_lower_bound(HydroTurbineFlowRateVariable, d, W),
Copy link
Copy Markdown
Collaborator

@luke-kiernan luke-kiernan Apr 28, 2026

Choose a reason for hiding this comment

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

nitpick: might be worth defining a function for this (variable, device, formulation_type) -> (min = ..., max = ...) pattern. Only 2 spots right now (so probably not), but will new PRs add more?

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>
@jd-lara jd-lara requested a review from rodrigomha May 12, 2026 19:46
@rodrigomha
Copy link
Copy Markdown
Contributor

@acostarelli Can you fix the conflicts to use what should remain? You can probably resolve the conflicts in the web

@acostarelli
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/FluxML/MacroTools.jl/tarball/1e0228a030642014fe5cfe68c2c0a818f9e3f522
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaArrays/ArrayInterface.jl/tarball/54f895554d05c83e3dd59f6a396671dae8999573
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArrays.jl/tarball/246a8bb2e6667f832eea063c3a56aef96429a3db
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArraysCore.jl/tarball/6ab403037779dae8c514bad259f32a447262455a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/ASL_jll.jl/tarball/6252039f98492252f9e47c312c8ffda0e3b9e78d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Blosc_jll.jl/tarball/535c80f1c0847a4c967ea945fca21becc9de1522
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Bzip2_jll.jl/tarball/1b96ea4a01afe0ea4090c5c8039690672dd13f2e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/HDF5_jll.jl/tarball/45337643a2d97262d5fe72ce1f13e8a662d13d62
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/HiGHS_jll.jl/tarball/50ed12dc8c37ebb8d2b759f21755259d8512f2bd
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Hwloc_jll.jl/tarball/baaaebd42ed9ee1bd9173cfd56910e55a8622ee1
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Ipopt_jll.jl/tarball/0d3939fb672b84082f3ee930b51de03df935be31
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/LLVMOpenMP_jll.jl/tarball/eb62a3deb62fc6d8822c0c4bef73e4412419c5d8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Libiconv_jll.jl/tarball/be484f5c92fad0bd8acfef35fe017900b0b73809
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Lz4_jll.jl/tarball/191686b1ac1ea9c89fc52e996ad15d1d241d1e33
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/METIS_jll.jl/tarball/2eefa8baa858871ae7770c98c3c2a7e46daba5b4
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MPIABI_jll.jl/tarball/9be143b6045719e8fb019d2b3bc2aebad1184fef
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MPICH_jll.jl/tarball/07dbec8aab01696edc0151a401a6cdfe95b9b885
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MPItrampoline_jll.jl/tarball/675df097f8eeb28998b2cfe3b25655af73d5f7df
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MUMPS_seq_jll.jl/tarball/f429d6bbe9ad015a2477077c9e89b978b8c26558
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/MicrosoftMPI_jll.jl/tarball/bc95bf4149bf535c09602e3acdf950d9b4376227
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenBLAS32_jll.jl/tarball/dd0d9979377e43918a80486a562ddedcc6d9bdf3
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenMPI_jll.jl/tarball/6d6c0ca4824268c1a7dca1f4721c535ac63d9074
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenSpecFun_jll.jl/tarball/1346c9208249809840c91b26703912dff463d335
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/SCS_jll.jl/tarball/f7864fb125fc5eb61fa2f2c5738623be0b986edd
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/SQLite_jll.jl/tarball/0b5f220f90642566b65ba86549d1ee4118ab2579
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/XML2_jll.jl/tarball/80d3930c6347cfce7ccf96bd3bafdf079d9c0390
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Xorg_libpciaccess_jll.jl/tarball/58972370b81423fc546c56a60ed1a009450177c3
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Zstd_jll.jl/tarball/446b23e73536f84e8037f5dce465e92275f6a308
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_auth_jll.jl/tarball/8cab83c96af80a1be968251ce1a0548a7545484d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_cal_jll.jl/tarball/22c0f42f4a1f0dc5dcfa8fd267c4ac407c455e7a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_common_jll.jl/tarball/a759cb9bf456ad792cc7898a81ae333cce9ef02a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_compression_jll.jl/tarball/7910c72f45f44afd297c39fe43b99c56d5ed22ec
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_http_jll.jl/tarball/e358d5a001ef7afbd4f8c5225322512819cda2f2
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_io_jll.jl/tarball/7e481d474b2087ee8bbf55b81bf9119f21e396d9
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_s3_jll.jl/tarball/3e9917ab25114feba657e71be41cad068b9f6595
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_c_sdkutils_jll.jl/tarball/c43dfba2c1ab9ea9f02f2c80e86fa16f6460244e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/aws_checksums_jll.jl/tarball/2570c8e23f4771a087b12a47edcaaa670ac05a01
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/dlfcn_win32_jll.jl/tarball/e141d67ffe550eadfb5af1bdbdaf138031e4805f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/libaec_jll.jl/tarball/1411bc34c180946d3cef591de1384012afa6edee
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/mpif_jll.jl/tarball/a8083ee0737c243c8f40a4ba86a0956997facb73
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/s2n_tls_jll.jl/tarball/64ae051c6f03044eb7d98027d1b552b4e21e650c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/AbstractTrees.jl/tarball/2d9c9a55f9c93e8887ad391fbae72f8ef55e1177
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/e86f4a2805f7f19bec5129bc9150c38208e5dc23
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/LeftChildRightSiblingTrees.jl/tarball/95ba48564903b43b2462318aa243ee79d81135ff
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaCollections/SortingAlgorithms.jl/tarball/64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/CSV.jl/tarball/8d8e0b0f350b8e1c91420b5e64e5de774c2f0f4d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/DataFrames.jl/tarball/5fab31e2e01e70ad66e3e24c968c264d1cf166d6
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/DataFramesMeta.jl/tarball/b0652fb7f3c094cf453bf22e699712a0bed9fc83
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/DelimitedFiles.jl/tarball/9e2f36d3c96a820c678f2f1f1782582fcf685bae
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/InvertedIndices.jl/tarball/6da3c4316095de0f5ee2ebd875df8721e7e0bdbe
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/Missings.jl/tarball/ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/Parsers.jl/tarball/5d5e0a78e971354b1c7bff0655d11fdc1b0e12c8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/PooledArrays.jl/tarball/36d8b4b899628fb92c2749eb488d884a926614d3
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/SentinelArrays.jl/tarball/ebe7e59b37c400f694f52b58c93d26201387da70
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/StructTypes.jl/tarball/159331b30e94d7b11379037feeb9b690950cace8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/TableMetadataTools.jl/tarball/c0405d3f8189bb9a9755e429c6ea2138fca7e31f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/WeakRefStrings.jl/tarball/0716e01c3b40413de5dedbc9c5c69f27cddfddfc
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaData/YAML.jl/tarball/a1c0c7585346251353cddede21f180b96388c403
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDatabases/DBInterface.jl/tarball/a444404b3f94deaa43ca2a58e18153a82695282b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDatabases/SQLite.jl/tarball/87b47a05946c50f44531b447b1f24968345316a4
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaDebug/CodeTracking.jl/tarball/cfb7a2e89e245a9d5016b70323db412b3a7438d5
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaDebug/JuliaInterpreter.jl/tarball/58927c485919bf17ea308d9d82156de1adf4b006
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDebug/LoweredCodeUtils.jl/tarball/5d4278f755440f70648d80cc6225f51e78e94094
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDiff/DiffResults.jl/tarball/782dd5f4561f5d267313f23853baaaa4c52ea621
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDiff/DiffRules.jl/tarball/23163d55f885173722d1e4cf0f6110cdbaf7e272
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDiff/DifferentiationInterface.jl/tarball/2147a95a217cc8a78ec96ee03581adf129468e49
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDiff/FiniteDiff.jl/tarball/f7017a4f337f8df189fcce98e32b67a1298a2115
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/tarball/cddeab6487248a39dae1a960fff0ac17b2a28888
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaGPU/Adapt.jl/tarball/0761717147821d696c9470a7a86364b2fbd22fd8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/Blosc.jl/tarball/310b77648d38c223d947ff3f50f511d08690b8d5
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/1a3ad7e16a321667698a19e77362b35a1e94c544
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/34d9873079e4cb3d0c62926a225136824677073f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/cee8104904c53d39eb94fd06cbe60cb5acde7177
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/CodecBzip2.jl/tarball/84990fa864b7f2b4901901ca12736e45ee79068c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/CodecZlib.jl/tarball/962834c22b66e32aa10f7611c08c8ca4e20749a9
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/FileIO.jl/tarball/8e9c059d6857607253e837730dbf780b6b151acd
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaIO/HDF5.jl/tarball/491ea627ac824619f34168e29a0427a9e00e3e40
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/HDF5.jl/tarball/d778420e524bcf56066e8c63c7aa315ae7269da2
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/JLD2.jl/tarball/941f87a0ae1b14d1ac2fa57245425b23a9d7a516
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/JSON.jl/tarball/fe23330af47b8ab4e135b2ff65f7398c3a2bfc65
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaIO/TranscodingStreams.jl/tarball/0c45878dcfdcfa8480052b6ab162cdd138781742
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLang/BaseCompiler.jl/tarball/382d79bfe72a406294faca39ef0c3cef6e6ce1f1
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/edbeefc7a4889f528644251bdb5fc9ab5348bc2c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLang/ScopedValues.jl/tarball/67a144433c4ce877ee6d1ada69a124d6b1ecf7be
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLogging/ProgressLogging.jl/tarball/f0803bc1171e455a04124affa9c21bba5ac4db32
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaLogging/TerminalLoggers.jl/tarball/f133fab380933d042f6796eda4e130272ba520ca
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/IrrationalConstants.jl/tarball/b2d91fe939cae05960e760110b328288867b5758
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/NaNMath.jl/tarball/9b8215b1ee9e78a293f99797cd31375471b2bcae
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaMath/SpecialFunctions.jl/tarball/2700b235561b0335d5bef7097a111dc513b8655e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaNLSolvers/LineSearches.jl/tarball/24dcd7871875cc8afdf2bb881137ea229aec16bc
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaNLSolvers/NLSolversBase.jl/tarball/b3f76b463c7998473062992b246045e6961a074e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaObjects/ConstructionBase.jl/tarball/b4b092499347b18a015186eae3042f72267106cb
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/7204148362dafe5fe6a273f855b8ccbe4df8173e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/8b770b60760d4451834fe79dd483e318eee709c4
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaParallel/MPI.jl/tarball/8e98d5d80b87403c311fd51e8455d4546ba7a5f8
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPhysics/Unitful.jl/tarball/57e1b2c9de4bd6f40ecb9de4ac1797b81970d008
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaPlots/Plots.jl/tarball/5c3d09cc4f31f5fc6af001c250bf1278733100ff
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaServices/StructUtils.jl/tarball/dd974aefe288ef2898733aecf40858dc86742d74
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaServices/WorkerUtilities.jl/tarball/cd1659ba0d57b71a464a29e64dbc67cfe83d54e7
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaSparse/KLU.jl/tarball/07649c499349dad9f08dde4243a4c597064663e9
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/LogExpFunctions.jl/tarball/13ca9e2586b89836fd20cccf56e57e2b9ae7f38f
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStats/TimeSeries.jl/tarball/e1235a1906d1e6d27c30c35daa91fcf6fc271f08
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaStrings/StringEncodings.jl/tarball/b765e46ba27ecf6b44faf70df40c57aa3a547dcb
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaTesting/Aqua.jl/tarball/d57fd255a8932b6509baf43284c416fc44d0b903
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/JuliaTesting/ExprTools.jl/tarball/27415f162e6028e81c72b82ef756bf321213b6ec
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/KristofferC/TimerOutputs.jl/tarball/3748bd928e68c7c346b52125cf41fff0de6937d0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/NLR-Sienna/PowerTableDataParser.jl/tarball/9973b3791bcc08c1640aa1030ab07b300354280d
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/SciML/ADTypes.jl/tarball/bbc22a9a08a0ef6460041086d8a7b27940ed4ffd
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/Sienna-Platform/PowerFlowFileParser.jl/tarball/8bf048c6c2f1bc9ce2d0fa848c2a48bc1504bd66
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/Sienna-Platform/PowerFlows.jl/tarball/73c61f8f3b0212ec84f87544967f37bfdfa610fb
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/Sienna-Platform/PowerNetworkMatrices.jl/tarball/b390a2818c24452868b1edd4110e70553338c7e0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jkrumbiegel/Chain.jl/tarball/765487f32aeece2cf28aa7038e29c31060cb5a69
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/joshday/StringTemplates.jl/tarball/d78012ad7c6c22aba229a6363ec83ebc9ce5c135
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jump-dev/HiGHS.jl/tarball/bf5e946f72ebd1b4620249a6be7ff34832ba9ca0
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jump-dev/Ipopt.jl/tarball/d99b87f31175f7b4908f8d3719397792498b63de
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jump-dev/JuMP.jl/tarball/6941586d9cf3c0af718bc6e6250dcf24057d412e
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jump-dev/MathOptIIS.jl/tarball/3b3d69130d8ab8c39d5fa4d30e20a8e6428c9d37
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jump-dev/MathOptInterface.jl/tarball/73939c06e863f8d68322106fdc2464f3443b5e1a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jump-dev/MutableArithmetics.jl/tarball/7c25249fc13a070f5ba433c50e21e22bb33c6fb0
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/jump-dev/SCS.jl/tarball/cd27f0cfefd06c7b2bd0343e08edbd9a3d2e1869
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/jverzani/Mustache.jl/tarball/3cbd5dda543bc59f2e482607ccf84b633724fc32
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/jw3126/Setfield.jl/tarball/c5391c6ace3bc430ca630251d02ea9687169ca68
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/nickrobinson251/PowerFlowData.jl/tarball/54d48d25e7d7511bbc8eb0ecff9e32f38c6f267c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/quinnj/JSON3.jl/tarball/411eccfe8aba0814ffa0fdf4860913ed09c34975
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/rdeits/CommonSubexpressions.jl/tarball/cda2cfaebb4be89c9084adaca7dd7333369715c5
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/rofinn/FilePathsBase.jl/tarball/3bab2c5aa25e7840a4b065805c0cdfc01f3068d2
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/624de6279ab7d94fc9f672f0068107eb6619732c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/d05693d339e37d6ab134c5ab53c29fce5ee5d7d5
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/ssfrr/DeepDiffs.jl/tarball/9824894295b62a6a4ab6adf1c7bf337b3a9ca34c
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/ssfrr/TestSetExtensions.jl/tarball/404df17d103e892dd24ab4bf46dd36a7c44f3414
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (http block)
  • https://api.github.com/repos/timholy/ProgressMeter.jl/tarball/fbb92c6c56b34e1a2c4c36058f68f332bec840e7
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/timholy/Revise.jl/tarball/5f4f629c085b87e71125eec6773f5f872c74a47a
    • Triggering command: REDACTED, pid is -1 (http block)
  • https://api.github.com/repos/vchuravy/HashArrayMappedTries.jl/tarball/2eaa69a7cab70a52b9687c8bf950a5a93ec895ae
    • Triggering command: REDACTED, pid is -1 (http block)
  • pkg.julialang.org
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.build(); Pkg.test() (dns block)
    • Triggering command: /usr/bin/julia julia --project=test -e using Pkg; Pkg.instantiate() -ljulia -ljulia-internal (dns block)
    • Triggering command: /usr/local/julia1.12.6/bin/julia /usr/local/julia1.12.6/bin/julia -C native -J/usr/local/julia1.12.6/lib/julia/sys.so -g1 --code-coverage=none --color=yes --check-bounds=yes --warn-overwrite=yes --depwarn=yes --inline=yes --startup-file=no --track-allocation=none --check-bounds=yes --output-o /home/REDACTED/.julia/compiled/v1.12/PowerSystemCaseBuilder/jl_O8pnGZ --output-ji /home/REDACTED/.julia/compiled/v1.12/PowerSystemCaseBuilder/jl_jTa8N8 --output-incremental=yes --startup-file=no (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

# Conflicts:
#	src/PowerOperationsModels.jl
#	src/static_injector_models/hydro_generation.jl
#	src/static_injector_models/hydrogeneration_constructor.jl
Comment thread test/test_device_hydro_constructors.jl Outdated

calculated_vf =
(hydro_vol_df[1, :value]) +
((total_inflow - total_outflow - total_spillage) * 3600 * 1e-9)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rather than using 3600 and 1e-9, can you use POM.SECONDS_IN_HOUR and POM.M3_TO_KM3, as defined here: https://github.com/Sienna-Platform/PowerOperationsModels.jl/blob/main/src/core/physical_constant_definitions.jl

Copy link
Copy Markdown
Contributor

@rodrigomha rodrigomha left a comment

Choose a reason for hiding this comment

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

Just minor comments in the tests for readability and trying to be consistent. After those changes we should be ready to merge.

Use POM.SECONDS_IN_HOUR / POM.M3_TO_KM3 in the m^3/s -> km^3
water-balance conversion instead of bare 3600 / 1e-9 literals, and
switch the volume-closure check to isapprox(...; atol = tol) with a
named tolerance and a brief comment on its sizing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@jd-lara jd-lara requested a review from rodrigomha May 14, 2026 02:17
Copy link
Copy Markdown
Contributor

@rodrigomha rodrigomha left a comment

Choose a reason for hiding this comment

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

this is looking good

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.

5 participants