-
Notifications
You must be signed in to change notification settings - Fork 81
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
Close multiple simple issues in PSY #1192
Changes from 10 commits
59d41b1
692dfe0
9dd3ef2
a62741c
676e777
d954dee
237d9ca
5adf0eb
d442df7
de30f69
7fc254a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -326,7 +326,6 @@ function read_loadzones!( | |
kwargs..., | ||
) | ||
@info "Reading LoadZones data in PowerModels dict to populate System ..." | ||
_get_name = get(kwargs, :loadzone_name_formatter, _get_pm_dict_name) | ||
zones = Set{Int}() | ||
zone_bus_map = Dict{Int, Vector}() | ||
for (_, bus) in data["bus"] | ||
|
@@ -346,9 +345,15 @@ function read_loadzones!( | |
load_zone_map[zone]["pd"] += get(load, "py", 0.0) | ||
load_zone_map[zone]["qd"] += get(load, "qy", 0.0) | ||
end | ||
|
||
default_loadzone_naming = string | ||
# The formatter for loadzone_name should be a function that transform the LoadZone Int to a String | ||
_get_name = get(kwargs, :loadzone_name_formatter, default_loadzone_naming) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get unit tests for this? |
||
|
||
for zone in zones | ||
name = _get_name(zone) | ||
load_zone = make_loadzone( | ||
string(zone), | ||
name, | ||
load_zone_map[zone]["pd"], | ||
load_zone_map[zone]["qd"]; | ||
kwargs..., | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -36,4 +36,15 @@ end | |||||
@test get_available(get_component(ThermalStandard, sys, "generator-2438-ND")) == 0 | ||||||
@test get_status(get_component(ThermalStandard, sys, "generator-2438-EG")) == 1 | ||||||
@test get_available(get_component(ThermalStandard, sys, "generator-2438-EG")) == 1 | ||||||
|
||||||
@info "Testing Load Zone Formatter" | ||||||
PSB.clear_serialized_systems("psse_Benchmark_4ger_33_2015_sys") | ||||||
sys3 = build_system( | ||||||
PSYTestSystems, | ||||||
"psse_Benchmark_4ger_33_2015_sys"; | ||||||
loadzone_name_formatter = x -> string(3 * x), | ||||||
) | ||||||
lz_original = first(get_components(LoadZone, sys2)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you can safely assume that the result of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is only one load zone for that system, that's why I can use first There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh okay There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick:
Suggested change
|
||||||
lz_new = first(get_components(LoadZone, sys3)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
@test parse(Int, get_name(lz_new)) == 3 * parse(Int, get_name(lz_original)) | ||||||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to make the version 5.0