Skip to content

Commit

Permalink
FIX: variable_mc_capcontrol kwargs
Browse files Browse the repository at this point in the history
was missing report and relax in each instance of variable_mc_capcontrol
  • Loading branch information
pseudocubic committed Jan 18, 2022
1 parent 9cbecb4 commit 5791df0
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- none

## v0.14.1

- Fix `variable_mc_capcontrol` keyword arguments

## v0.14.0

- Drop support for JuMP < v0.22
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "PowerModelsDistribution"
uuid = "d7431456-977f-11e9-2de3-97ff7677985e"
authors = ["David M Fobes <[email protected]>", "Carleton Coffrin"]
repo = "https://github.com/lanl-ansi/PowerModelsDistribution.jl.git"
version = "0.14.0"
version = "0.14.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
4 changes: 3 additions & 1 deletion src/core/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ end
Capacitor (with capcontrol) relaxed power variables for AbstractLPUBFModel (using McCormick envelopes)
"""
function variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default)
function variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel; nw::Int=nw_id_default, report::Bool=false)
cap_switch_ids = [id for (id,cap) in ref(pm, nw, :shunt) if haskey(cap,"controls")]
cap_reactive_power = var(pm, nw)[:capacitor_reactive_power] = Dict(
i => JuMP.@variable(
Expand All @@ -771,6 +771,8 @@ function variable_mc_capacitor_reactive_power(pm::AbstractUnbalancedPowerModel;
base_name="$(nw)_cap_cur_$(i)",
) for i in cap_switch_ids
)

report && _IM.sol_component_value(pm, pmd_it_sym, nw, :shunt, :capacitor_reactive_power, cap_switch_ids, cap_reactive_power)
end


Expand Down
6 changes: 3 additions & 3 deletions src/form/acp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ end


"""
variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Capacitor switching variables.
"""
function variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax)
function variable_mc_capcontrol(pm::AbstractUnbalancedACPModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report)
end


Expand Down
6 changes: 3 additions & 3 deletions src/form/acr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ end


"""
variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Capacitor switching variables.
"""
function variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax)
function variable_mc_capcontrol(pm::AbstractUnbalancedACRModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report)
end


Expand Down
2 changes: 1 addition & 1 deletion src/form/apo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ end


"nothing to do, these models do not have complex voltage variables"
function variable_mc_capcontrol(pm::AbstractUnbalancedNFAModel; nw::Int=nw_id_default, bounded::Bool=true, report::Bool=true)
function variable_mc_capcontrol(pm::AbstractUnbalancedNFAModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
end


Expand Down
6 changes: 3 additions & 3 deletions src/form/bf_fbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ end


"""
variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Capacitor switching variables.
"""
function variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax)
function variable_mc_capcontrol(pm::FBSUBFPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report)
end


Expand Down
8 changes: 4 additions & 4 deletions src/form/bf_mx_lin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ end


"""
variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Capacitor switching and relaxed power variables.
"""
function variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax)
variable_mc_capacitor_reactive_power(pm; nw=nw)
function variable_mc_capcontrol(pm::AbstractLPUBFModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report)
variable_mc_capacitor_reactive_power(pm; nw=nw, report=report)
end


Expand Down
6 changes: 3 additions & 3 deletions src/form/fotr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ end


"""
variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
Capacitor switching variables.
"""
function variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax)
function variable_mc_capcontrol(pm::FOTRUPowerModel; nw::Int=nw_id_default, relax::Bool=false, report::Bool=true)
variable_mc_capacitor_switch_state(pm; nw=nw, relax=relax, report=report)
end


Expand Down

2 comments on commit 5791df0

@pseudocubic
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/52788

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.14.1 -m "<description of version>" 5791df0e54a2a001c0cfec60d2eb2cdb977c71ca
git push origin v0.14.1

Please sign in to comment.