Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PSSE raw import for gen_status at load buses #934

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/io/psse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function _psse2pm_generator!(pm_data::Dict, pti_data::Dict, import_all::Bool)
sub_data = Dict{String,Any}()

sub_data["gen_bus"] = pop!(gen, "I")
sub_data["gen_status"] = pop!(gen, "STAT")
sub_data["gen_status"] = _get_bus_value(sub_data["gen_bus"], "bus_type", pm_data) == 1 ? begin delete!(gen, "STAT"); 0 end : pop!(gen, "STAT") # In PSSE active generators at bus type 1 are ignored. PQ or PV control mode is controlled by "Machine Control Mode" parameter (Machine Data Record -> Wind Data -> Control Mode)
sub_data["pg"] = pop!(gen, "PG")
sub_data["qg"] = pop!(gen, "QG")
sub_data["vg"] = pop!(gen, "VS")
Expand Down
2 changes: 1 addition & 1 deletion test/data/pti/frankenstein_70.raw
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ developed by Carleton Coffrin ([email protected]) June 2017
1002,'FAV SPOT 02', 345.0000, 2, 101, 201, 301,1.00000000, 0.000000, 1.10000, 0.90000, 1.10000, 0.90000
1003,'FAV SPOT 03', 24.9000, 2, 101, 201, 301,1.00000000, 0.000000, 1.10000, 0.90000, 1.10000, 0.90000
1004,'FAV SPOT 04', 87.0000, 1, 101, 201, 301,1.05000000, 0.000000, 1.10000, 0.90000, 1.10000, 0.90000
1005,'FAV PLACE 05', 87.0000, 2, 101, 201, 301,1.00000000, 3.000000, 1.10000, 0.90000, 1.10000, 0.90000
1005,'FAV PLACE 05', 87.0000, 1, 101, 201, 301,1.00000000, 3.000000, 1.10000, 0.90000, 1.10000, 0.90000
1006,'FAV SPOT 06', 87.0000, 1, 101, 201, 301,1.00000000, -1.000000, 1.10000, 0.90000, 1.10000, 0.90000
1007,'FAV PLACE 07', 230.0000, 1, 101, 201, 301,1.00000000, 2.000000, 1.10000, 0.90000, 1.10000, 0.90000
1008,'FAV PLC 08', 87.0000, 2, 101, 201, 301,0.95000000, 0.000000, 1.10000, 0.90000, 1.10000, 0.90000
Expand Down
16 changes: 14 additions & 2 deletions test/psse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ end
end
end


@testset "transformer status" begin
@testset "two-winding transformers" begin
data_pti = PowerModels.parse_file("../test/data/pti/case5.raw")
Expand Down Expand Up @@ -423,7 +422,20 @@ end
end
end

@testset "generator status" begin
data_pti = PowerModels.parse_file("../test/data/pti/frankenstein_70.raw")

gen_off = Set(["1", "5"])
for (i,gen) in data_pti["gen"]
if i in gen_off
@test gen["gen_status"] == 0
else
@test gen["gen_status"] == 1
end
end
end


@testset "import all" begin
@testset "30-bus case" begin
data = PowerModels.parse_file("../test/data/pti/case30.raw"; import_all=true)
Expand Down Expand Up @@ -540,7 +552,7 @@ end
end
end

@testset "Impedance and Current Load Conversions" begin
@testset "Impedance and Current Load Conversions" begin
data = PowerModels.parse_file("../test/data/pti//parser_test_k.raw")
Vm_load = data["bus"]["103"]["vm"]
# Test current load only
Expand Down
Loading