-
Notifications
You must be signed in to change notification settings - Fork 52
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
[DNMY] Support in the loop PowerFlow evaluation #1040
base: main
Are you sure you want to change the base?
Conversation
pf_data = get_power_flow_data(pf_e_data) | ||
# Maps the StaticInjection component type by name to the | ||
# index in the PowerFlow data arrays going from Bus number to bus index | ||
temp_component_bus_map = Dict{DataType, Dict{String, Int}}() |
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.
It looks like wherever temp_component_bus_map
is read, both a type and a name are being passed in to get directly to a bus number. Since we never make use of the nested structure, I'd recommend Dict{Tuple{DataType, String}, Int}
; that should also simplify the first loop a bit.
name_bus_ix_map = Dict{String, Int}() | ||
comp_type = get_component_type(key) | ||
push!(added_injection_types, comp_type) | ||
for n in axes(array)[1] |
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.
Assuming n
here is a component name because that is how it is used, maybe rename so it doesn't sound like a number. Also, what would be the best way for me to obtain a typical OptimizationContainer
that would get passed to this function so I can experiment with how it works?
end | ||
|
||
for (key, array) in get_aux_variables(container) | ||
if get_entry_type(key) ∉ ACTIVE_POWER_INJECTION_KEYS |
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.
Helper function-ify the entire loop to avoid code duplication across variables, aux_variables, parameters
This is a WIP branch to integrate the evaluation of PowerFlows into a simulation loop.