Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Mar 4, 2025
1 parent 8e1b6d7 commit 04778f3
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 1 deletion.
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 InexactError in `compute_ac_pf` (#939)

### v0.21.3
- Fix no-buses bug in `calc_connected_components` (#933)
Expand Down
118 changes: 118 additions & 0 deletions test/data/json/issue_938.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"baseMVA": 1000,
"per_unit": true,
"shunt": {},
"storage": {},
"switch": {},
"dcline": {},
"load": {
"1": {
"load_bus": 1,
"pd": 0.1,
"qd": 0,
"index": 1,
"status": 1
}
},
"gen": {
"2": {
"gen_bus": 2,
"pg": 0.1,
"qg": 0,
"pmax": 1,
"pmin": 0,
"qmax": 9999,
"qmin": -9999,
"index": 2,
"vg": 1,
"gen_status": 1
},
"3": {
"gen_bus": 3,
"pg": 0,
"qg": 0,
"pmax": 9999,
"pmin": 0,
"qmax": 9999,
"qmin": -9999,
"index": 3,
"vg": 1,
"gen_status": 1
}
},
"branch": {
"5": {
"index": 5,
"f_bus": 1,
"t_bus": 2,
"br_r": 0.06815,
"br_x": 1.096,
"b_fr": 0.03092,
"b_to": 0.03092,
"br_status": 1,
"base_kv": 220,
"c_rating_a": 1.959,
"angmin": -0.17453292519943295,
"angmax": 0.17453292519943295,
"transformer": false,
"tap": 1,
"shift": 0,
"g_fr": 0,
"g_to": 0
},
"6": {
"index": 6,
"f_bus": 2,
"t_bus": 3,
"br_r": 0.06744,
"br_x": 1.084,
"b_fr": 0.03059,
"b_to": 0.03059,
"br_status": 1,
"base_kv": 220,
"c_rating_a": 1.959,
"angmin": -0.17453292519943295,
"angmax": 0.17453292519943295,
"transformer": false,
"tap": 1,
"shift": 0,
"g_fr": 0,
"g_to": 0
}
},
"bus": {
"1": {
"bus_type": 1,
"vm": 1,
"va": 0,
"vmin": 0.5,
"vmax": 1.5,
"index": 1,
"gen_status": 1,
"base_kv": 400.0,
"bus_i": 1
},
"2": {
"bus_type": 2,
"vm": 1,
"va": 0,
"vmin": 0.5,
"vmax": 1.5,
"index": 2,
"gen_status": 1,
"base_kv": 400.0,
"bus_i": 2
},
"3": {
"bus_type": 3,
"vm": 1,
"va": 0,
"vmin": 0.5,
"vmax": 1.5,
"index": 3,
"gen_status": 1,
"base_kv": 220.0,
"bus_i": 3
}
}
}
6 changes: 6 additions & 0 deletions test/pf-native.jl
Original file line number Diff line number Diff line change
Expand Up @@ -501,5 +501,11 @@ end
@test isapprox(data["gen"][i]["qg"], gen["qg"]; atol = 1e-6)
end
end
@testset "test_issue_938" begin
filename = joinpath(@__DIR__, "data/json/issue_938.json")
data = PowerModels.parse_file(filename)
native = PowerModels.compute_ac_pf(data)
@test native["termination_status"]
end
end

0 comments on commit 04778f3

Please sign in to comment.