Skip to content

Commit

Permalink
add test and fix to calc_theta_delta_bounds for multiconductor case
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoffrin committed Aug 11, 2023
1 parent e9712cd commit 257b5eb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions test/data-mc.jl
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ include("common.jl")

include("data.jl")

include("data-mc.jl")

include("data-basic.jl")

include("model.jl")
Expand Down

0 comments on commit 257b5eb

Please sign in to comment.