From eb21c13057a8aba6ab71efdcd392624e68e1063b Mon Sep 17 00:00:00 2001 From: Carleton Coffrin Date: Thu, 10 Aug 2023 19:19:24 -0600 Subject: [PATCH] add test and fix to calc_theta_delta_bounds for multiconductor case (#871) --- CHANGELOG.md | 2 +- src/core/data.jl | 2 +- test/data-mc.jl | 13 +++++++++++++ test/runtests.jl | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 test/data-mc.jl diff --git a/CHANGELOG.md b/CHANGELOG.md index d303a3b5..345ad3f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ PowerModels.jl Change Log ========================= ### Staged -- nothing +- Fix implementation of `calc_theta_delta_bounds` when conductor parameter is used (#870) ### v0.19.9 - Fix implementation of polynomial costs above quadratic diff --git a/src/core/data.jl b/src/core/data.jl index 884af01e..a13998e1 100644 --- a/src/core/data.jl +++ b/src/core/data.jl @@ -73,7 +73,7 @@ function calc_theta_delta_bounds(data::Dict{String,<:Any}) end if haskey(data, "conductors") - return amin, amax + return angle_min, angle_max else return angle_min[1], angle_max[1] end diff --git a/test/data-mc.jl b/test/data-mc.jl new file mode 100644 index 00000000..ec8cf1bf --- /dev/null +++ b/test/data-mc.jl @@ -0,0 +1,13 @@ +@testset "test multiconductor data" begin + + @testset "multiconductor calc_theta_delta_bounds" begin + data = PowerModels.parse_file("../test/data/matpower/case5.m") + data["conductors"] = 1 + + theta_lb, theta_ub = calc_theta_delta_bounds(data) + + @test theta_lb[1] <= -2.0 + @test theta_ub[1] >= 2.0 + end + +end \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 49c7902f..dcaa3b33 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -54,6 +54,8 @@ include("common.jl") include("data.jl") + include("data-mc.jl") + include("data-basic.jl") include("model.jl")