Harden TDR demand multipliers for zero-demand inputs#903
Draft
Harden TDR demand multipliers for zero-demand inputs#903
Conversation
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Co-authored-by: gschivley <10373332+gschivley@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix TDR returning NaN for zero demand input
Harden TDR demand multipliers for zero-demand inputs
Feb 10, 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.
TDR returns NaNs when demand is zero for all hours in a zone because demand multipliers divide by a zero clustered total. This adjusts the multiplier logic and adds coverage for zero and normal cases.
Multiplier guardrails
Regression coverage
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/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaArrays/ArrayInterface.jl/tarball/d81ae5489e13bc03567d4fbbb06c546a5e53c857/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaArrays/StaticArrays.jl/tarball/eee1b9ad8b29ef0d936e3ec9838c7ec089620308/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaArrays/StaticArraysCore.jl/tarball/6ab403037779dae8c514bad259f32a447262455a/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaBinaryWrappers/Bzip2_jll.jl/tarball/1b96ea4a01afe0ea4090c5c8039690672dd13f2e/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaBinaryWrappers/HiGHS_jll.jl/tarball/f2a01e86ec9497bf468aabd0f61201731c755907/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaBinaryWrappers/Libiconv_jll.jl/tarball/be484f5c92fad0bd8acfef35fe017900b0b73809/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaBinaryWrappers/OpenBLAS32_jll.jl/tarball/46cce8b42186882811da4ce1f4c7208b02deb716/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaBinaryWrappers/OpenSpecFun_jll.jl/tarball/1346c9208249809840c91b26703912dff463d335/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaBinaryWrappers/Zstd_jll.jl/tarball/446b23e73536f84e8037f5dce465e92275f6a308/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaCI/BenchmarkTools.jl/tarball/7fecfb1123b8d0232218e2da0c213004ff15358d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/4e1fe97fdaed23e9dc21d4d664bea76b65fc50a0/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaCollections/SortingAlgorithms.jl/tarball/64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/CSV.jl/tarball/deddd8725e5e1cc49ee205a1964256043720a6c3/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/DataFrames.jl/tarball/d8928e9169ff76c6281f39a659f9bca3a573f24c/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/InvertedIndices.jl/tarball/6da3c4316095de0f5ee2ebd875df8721e7e0bdbe/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/Missings.jl/tarball/ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/Parsers.jl/tarball/7d2f8f21da5db6a806faf7b9b292296da42b2810/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/PooledArrays.jl/tarball/36d8b4b899628fb92c2749eb488d884a926614d3/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/SentinelArrays.jl/tarball/ebe7e59b37c400f694f52b58c93d26201387da70/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/WeakRefStrings.jl/tarball/b1be2855ed9ed8eac54e5caff2afcdb442d52c23/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaData/YAML.jl/tarball/a1c0c7585346251353cddede21f180b96388c403/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaDiff/DiffResults.jl/tarball/782dd5f4561f5d267313f23853baaaa4c52ea621/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaDiff/DiffRules.jl/tarball/23163d55f885173722d1e4cf0f6110cdbaf7e272/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/tarball/eef4c86803f47dcb61e9b8790ecaa96956fdd8ae/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaFunctional/CompositionsBase.jl/tarball/802bb88cd69dfd1509f6670416bd4434015693ad/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaGPU/Adapt.jl/tarball/7e35fca2bdfba44d797c53dfe63a51fabf39bfc0/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaGPU/GPUArrays.jl/tarball/83cf05ab16a73219e5f6bd1bdfa9848fa24ac627/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/1a3ad7e16a321667698a19e77362b35a1e94c544/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/34d9873079e4cb3d0c62926a225136824677073f/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/ChunkCodecs.jl/tarball/cee8104904c53d39eb94fd06cbe60cb5acde7177/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/CodecBzip2.jl/tarball/84990fa864b7f2b4901901ca12736e45ee79068c/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/CodecZlib.jl/tarball/962834c22b66e32aa10f7611c08c8ca4e20749a9/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/FileIO.jl/tarball/6522cfb3b8fe97bec632252263057996cbd3de20/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/JLD2.jl/tarball/8f8ff711442d1f4cfc0d86133e7ee03d62ec9b98/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/JSON.jl/tarball/b3ad4a0255688dcb895a52fafbaae3023b588a90/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaIO/TranscodingStreams.jl/tarball/0c45878dcfdcfa8480052b6ab162cdd138781742/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaLang/ScopedValues.jl/tarball/c3b2323466378a2ba15bea4b2f73b081e022f473/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaLogging/LoggingExtras.jl/tarball/f00544d95982ea270145636c181ceda21c4e2575/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaMath/Combinatorics.jl/tarball/c761b00e7755700f9cdf5b02039939d1359330e1/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaMath/InverseFunctions.jl/tarball/a779299d77cd080bf77b97535acecd73e1c5e5cb/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaMath/IrrationalConstants.jl/tarball/b2d91fe939cae05960e760110b328288867b5758/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaMath/NaNMath.jl/tarball/9b8215b1ee9e78a293f99797cd31375471b2bcae/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaMath/SpecialFunctions.jl/tarball/f2685b435df2613e25fc10ad8c26dddb8640f547/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaObjects/Accessors.jl/tarball/856ecd7cebb68e5fc87abecd2326ad59f0f911f3/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaObjects/ConstructionBase.jl/tarball/b4b092499347b18a015186eae3042f72267106cb/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/0533e564aae234aff59ab625543145446d8b6ec2/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/522f093a29b31a93e34eaea17ba055d850edea28/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaPlots/Plots.jl/tarball/5c3d09cc4f31f5fc6af001c250bf1278733100ff/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaServices/StructUtils.jl/tarball/9297459be9e338e546f5c4bedb59b3b5674da7f1/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaServices/WorkerUtilities.jl/tarball/cd1659ba0d57b71a464a29e64dbc67cfe83d54e7/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/Clustering.jl/tarball/3e22db924e2945282e70c33b75d4dde8bfa44c94/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/Distances.jl/tarball/c7e3a542b999843086e2f29dac96a618c105be1d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/LogExpFunctions.jl/tarball/13ca9e2586b89836fd20cccf56e57e2b9ae7f38f/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/StatsAPI.jl/tarball/178ed29fd5b2a2cfc3bd31c13375ae925623ff36/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStats/StatsBase.jl/tarball/aceda6f4e598d331548e04cc6b2124a6148138e3/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaStrings/StringEncodings.jl/tarball/b765e46ba27ecf6b44faf70df40c57aa3a547dcb/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/JuliaTesting/ExprTools.jl/tarball/27415f162e6028e81c72b82ef756bf321213b6ec/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/KristofferC/NearestNeighbors.jl/tarball/ca7e18198a166a1f3eb92a3650d53d94ed8ca8a1/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/LilithHafner/AliasTables.jl/tarball/9876e1e164b144ca45e9e3198d0b689cadfed9ff/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/LilithHafner/PtrArrays.jl/tarball/1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/SciML/RecursiveArrayTools.jl/tarball/81750fa442cc5cb3ab1ba89b1cdf8eda543e6905/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/SciML/RuntimeGeneratedFunctions.jl/tarball/7257165d5477fd1025f7cb656019dcb6b0512c38/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/SciML/SymbolicIndexingInterface.jl/tarball/94c58884e013efff548002e8dc2fdd1cb74dfce5/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/jump-dev/HiGHS.jl/tarball/e9f25ea411703f3070dc318f2f3a50defaf1d05b/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/jump-dev/JuMP.jl/tarball/8e4088727b5a130c12b1fedbc316306b6bbf2b9d/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/jump-dev/MathOptIIS.jl/tarball/31d4a6353ea00603104f11384aa44dd8b7162b28/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/jump-dev/MathOptInterface.jl/tarball/7fb98657926ccb4de8f9bb96cda453700ca39a8b/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/jump-dev/MutableArithmetics.jl/tarball/22df8573f8e7c593ac205455ca088989d0a2c7a0/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/rdeits/CommonSubexpressions.jl/tarball/cda2cfaebb4be89c9084adaca7dd7333369715c5/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/rofinn/FilePathsBase.jl/tarball/3bab2c5aa25e7840a4b065805c0cdfc01f3068d2/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/c5a07210bd060d6a8491b0ccdee2fa0235fc00bf/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/a3c1536470bf8c5e02096ad4853606d7c8f62721/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)https://api.github.com/repos/vchuravy/HashArrayMappedTries.jl/tarball/2eaa69a7cab70a52b9687c8bf950a5a93ec895ae/usr/bin/julia julia --project -e using Pkg; Pkg.test()(http block)pkg.julialang.org/usr/bin/julia julia --project -e using Pkg; Pkg.test()(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.