Skip to content

Fix MIP output failure from unconditional dual access in write_capacity#898

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/fix-capacity-output-issue
Draft

Fix MIP output failure from unconditional dual access in write_capacity#898
Copilot wants to merge 3 commits intomainfrom
copilot/fix-capacity-output-issue

Conversation

Copy link

Copilot AI commented Jan 20, 2026

MIP runs (with UCommit>0) fail during output writing with "Gurobi Error 10005: Unable to retrieve attribute 'Pi'" because write_capacity.jl unconditionally accesses duals from the cMaxCap constraint, even when WriteShadowPrices=0.

Changes

  • Guard dual access with has_duals(EP) check in write_capacity.jl (lines 51-56)
  • When duals unavailable, capacity_constraint_dual remains zeros as initialized
  • Fix typo in docstring: "diferent" → "different"
capacity_constraint_dual = zeros(size(inputs["RESOURCE_NAMES"]))
if has_duals(EP)
    for y in ids_with_positive(gen, max_cap_mw)
        capacity_constraint_dual[y] = -dual.(EP[:cMaxCap][y])
    end
end

This matches the pattern used in write_net_revenue.jl and write_emissions.jl.

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: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaArrays/ArrayInterface.jl/tarball/d81ae5489e13bc03567d4fbbb06c546a5e53c857
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArrays.jl/tarball/eee1b9ad8b29ef0d936e3ec9838c7ec089620308
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaArrays/StaticArraysCore.jl/tarball/6ab403037779dae8c514bad259f32a447262455a
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Bzip2_jll.jl/tarball/1b96ea4a01afe0ea4090c5c8039690672dd13f2e
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/HiGHS_jll.jl/tarball/e0539aa3405df00e963a9a56d5e903a280f328e7
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/Libiconv_jll.jl/tarball/be484f5c92fad0bd8acfef35fe017900b0b73809
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/METIS_jll.jl/tarball/2eefa8baa858871ae7770c98c3c2a7e46daba5b4
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenBLAS32_jll.jl/tarball/ece4587683695fe4c5f20e990da0ed7e83c351e7
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaBinaryWrappers/OpenSpecFun_jll.jl/tarball/1346c9208249809840c91b26703912dff463d335
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaCI/BenchmarkTools.jl/tarball/7fecfb1123b8d0232218e2da0c213004ff15358d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/4e1fe97fdaed23e9dc21d4d664bea76b65fc50a0
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaCollections/SortingAlgorithms.jl/tarball/64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/CSV.jl/tarball/deddd8725e5e1cc49ee205a1964256043720a6c3
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/DataFrames.jl/tarball/d8928e9169ff76c6281f39a659f9bca3a573f24c
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/InvertedIndices.jl/tarball/6da3c4316095de0f5ee2ebd875df8721e7e0bdbe
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/Missings.jl/tarball/ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/Parsers.jl/tarball/7d2f8f21da5db6a806faf7b9b292296da42b2810
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/PooledArrays.jl/tarball/36d8b4b899628fb92c2749eb488d884a926614d3
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/SentinelArrays.jl/tarball/ebe7e59b37c400f694f52b58c93d26201387da70
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/StructTypes.jl/tarball/159331b30e94d7b11379037feeb9b690950cace8
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/WeakRefStrings.jl/tarball/b1be2855ed9ed8eac54e5caff2afcdb442d52c23
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaData/YAML.jl/tarball/a1c0c7585346251353cddede21f180b96388c403
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaDiff/DiffResults.jl/tarball/782dd5f4561f5d267313f23853baaaa4c52ea621
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaDiff/DiffRules.jl/tarball/23163d55f885173722d1e4cf0f6110cdbaf7e272
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/tarball/b2977f86ed76484de6f29d5b36f2fa686f085487
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaDocs/DocStringExtensions.jl/tarball/7442a5dfe1ebb773c29cc2962a8980f47221d76c
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaFunctional/CompositionsBase.jl/tarball/802bb88cd69dfd1509f6670416bd4434015693ad
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaGPU/Adapt.jl/tarball/7e35fca2bdfba44d797c53dfe63a51fabf39bfc0
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaGPU/GPUArrays.jl/tarball/83cf05ab16a73219e5f6bd1bdfa9848fa24ac627
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaIO/CodecBzip2.jl/tarball/84990fa864b7f2b4901901ca12736e45ee79068c
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaIO/CodecZlib.jl/tarball/962834c22b66e32aa10f7611c08c8ca4e20749a9
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaIO/JSON.jl/tarball/b3ad4a0255688dcb895a52fafbaae3023b588a90
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaIO/TranscodingStreams.jl/tarball/0c45878dcfdcfa8480052b6ab162cdd138781742
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaMath/Combinatorics.jl/tarball/c761b00e7755700f9cdf5b02039939d1359330e1
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaMath/InverseFunctions.jl/tarball/a779299d77cd080bf77b97535acecd73e1c5e5cb
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaMath/IrrationalConstants.jl/tarball/b2d91fe939cae05960e760110b328288867b5758
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaMath/NaNMath.jl/tarball/9b8215b1ee9e78a293f99797cd31375471b2bcae
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaMath/SpecialFunctions.jl/tarball/f2685b435df2613e25fc10ad8c26dddb8640f547
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaObjects/Accessors.jl/tarball/856ecd7cebb68e5fc87abecd2326ad59f0f911f3
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaObjects/ConstructionBase.jl/tarball/b4b092499347b18a015186eae3042f72267106cb
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaPackaging/JLLWrappers.jl/tarball/0533e564aae234aff59ab625543145446d8b6ec2
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/522f093a29b31a93e34eaea17ba055d850edea28
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaPlots/Plots.jl/tarball/5c3d09cc4f31f5fc6af001c250bf1278733100ff
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaServices/StructUtils.jl/tarball/9297459be9e338e546f5c4bedb59b3b5674da7f1
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaServices/WorkerUtilities.jl/tarball/cd1659ba0d57b71a464a29e64dbc67cfe83d54e7
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStats/Clustering.jl/tarball/3e22db924e2945282e70c33b75d4dde8bfa44c94
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStats/Distances.jl/tarball/c7e3a542b999843086e2f29dac96a618c105be1d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStats/LogExpFunctions.jl/tarball/13ca9e2586b89836fd20cccf56e57e2b9ae7f38f
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStats/StatsAPI.jl/tarball/178ed29fd5b2a2cfc3bd31c13375ae925623ff36
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStats/StatsBase.jl/tarball/aceda6f4e598d331548e04cc6b2124a6148138e3
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaStrings/StringEncodings.jl/tarball/b765e46ba27ecf6b44faf70df40c57aa3a547dcb
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/JuliaTesting/ExprTools.jl/tarball/27415f162e6028e81c72b82ef756bf321213b6ec
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/KristofferC/NearestNeighbors.jl/tarball/ca7e18198a166a1f3eb92a3650d53d94ed8ca8a1
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/LilithHafner/AliasTables.jl/tarball/9876e1e164b144ca45e9e3198d0b689cadfed9ff
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/LilithHafner/PtrArrays.jl/tarball/1d36ef11a9aaf1e8b74dacc6a731dd1de8fd493d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/SciML/RecursiveArrayTools.jl/tarball/31b3d7b7e14faad39583475b89aadbd9c3e7ef8b
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/SciML/RuntimeGeneratedFunctions.jl/tarball/2f609ec2295c452685d3142bc4df202686e555d2
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/SciML/SymbolicIndexingInterface.jl/tarball/94c58884e013efff548002e8dc2fdd1cb74dfce5
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/jump-dev/HiGHS.jl/tarball/7eaca80074d6389bbf83e4dfb1eaf6b3cd78d150
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/jump-dev/JuMP.jl/tarball/8e4088727b5a130c12b1fedbc316306b6bbf2b9d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/jump-dev/MathOptIIS.jl/tarball/31d4a6353ea00603104f11384aa44dd8b7162b28
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/jump-dev/MathOptInterface.jl/tarball/181c2611c7aa6a362fdf937b1e2af55e6691181f
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/jump-dev/MutableArithmetics.jl/tarball/22df8573f8e7c593ac205455ca088989d0a2c7a0
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/quinnj/JSON3.jl/tarball/411eccfe8aba0814ffa0fdf4860913ed09c34975
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/rdeits/CommonSubexpressions.jl/tarball/cda2cfaebb4be89c9084adaca7dd7333369715c5
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/rofinn/FilePathsBase.jl/tarball/3bab2c5aa25e7840a4b065805c0cdfc01f3068d2
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/c5a07210bd060d6a8491b0ccdee2fa0235fc00bf
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/a3c1536470bf8c5e02096ad4853606d7c8f62721
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (http block)
  • pkg.julialang.org
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() n.jl .jl un.jl /Run.jl ox/Run.jl (dns block)

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

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: MIP run fails when writing capacity outputs due to unconditional dual access for cMaxCap</issue_title>
<issue_description>### Bug description

In GenX MIP runs (e.g. discrete capacity or operational decisions), output writing can fail with:

Gurobi Error 10005: Unable to retrieve attribute 'Pi'

This happens in write_capacity.jl when it always calls dual(EP[:cMaxCap][y]), even when duals are unavailable for MIP solutions. This is triggered even if WriteShadowPrices=0 in genx_settings.yml.

Steps to reproduce:

Run a MIP GenX case with Gurobi (UCommit>0).
Ensure outputs include capacity (WriteCapacity=1).
Observe crash during output writing with Pi error.

Expected:
Outputs should be written without requiring duals when shadow prices are disabled.

Actual:
write_capacity.jl attempts to read duals from cMaxCap, causing a solver error and output failure.

Suggested fix:
Guard dual access in write_capacity.jl:

If !has_duals(EP), leave capacity constraint duals at zero (or skip entirely).
Example patch:
capacity_constraint_dual = zeros(size(inputs["RESOURCE_NAMES"]))
if has_duals(EP)
    for y in ids_with_positive(gen, max_cap_mw)
        capacity_constraint_dual[y] = -dual.(EP[:cMaxCap][y])
    end
end

Notes:

This matches how other outputs handle duals (gated by has_duals or WriteShadowPrices).
This error occurs even when WriteShadowPrices=0.

This Bug Report written by GTP-5.2-Codex with direction from @JesseJenkins

Environment and Version

This is run on a local branch of GenX with Benders implemented, so it may not match the current Main. Please check that this usage occurs in the main branch as well. If it does not, then close this Bug report out.

Relevant error messages

Gurobi Error 10005: Unable to retrieve attribute 'Pi'

Additional context

No response</issue_description>

<agent_instructions>Check that this error is reproduced in the current Main branch. If so, then implement the suggested fix in a PR and submit to Develop branch for review. If the error is not reproduced, then write a summary of the test performed and respond to this Issue.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 20, 2026 00:23
Co-authored-by: JesseJenkins <10455496+JesseJenkins@users.noreply.github.com>
Co-authored-by: JesseJenkins <10455496+JesseJenkins@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MIP run failure when writing capacity outputs Fix MIP output failure from unconditional dual access in write_capacity Jan 20, 2026
Copilot AI requested a review from JesseJenkins January 20, 2026 00:36
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.

[Bug]: MIP run fails when writing capacity outputs due to unconditional dual access for cMaxCap

2 participants