From 34fc00242deebf20c6f7eba45969f3a9d64f187a Mon Sep 17 00:00:00 2001 From: ccoffrin Date: Wed, 5 Feb 2020 09:38:01 -0500 Subject: [PATCH] fix single variable solution reporting bug --- CHANGELOG.md | 3 +++ Project.toml | 2 +- src/core/solution.jl | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b62286cd..8e7d517c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ PowerModels.jl Change Log ### Staged - nothing +### v0.14.3 +- Fixed solution reporting bug with individual variables + ### v0.14.2 - Fixed solution reporting bug when component status did not match bus status diff --git a/Project.toml b/Project.toml index 24be62231..0d94ba304 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "PowerModels" uuid = "c36e90e8-916a-50a6-bd94-075b64ef4655" authors = ["Carleton Coffrin"] repo = "https://github.com/lanl-ansi/PowerModels.jl" -version = "0.14.2" +version = "0.14.3" [deps] InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0" diff --git a/src/core/solution.jl b/src/core/solution.jl index 9035c314a..ee753af43 100644 --- a/src/core/solution.jl +++ b/src/core/solution.jl @@ -204,6 +204,10 @@ function Base.haskey(cont::JuMP.Containers.DenseAxisArray, key) return isassigned(cont,key) end +function Base.haskey(cont::JuMP.VariableRef, key::Int) + return (key == 1) +end + "adds values based on JuMP variables" function add_setpoint!( sol,