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

Breaking Updates for v0.20 Release #900

Merged
merged 29 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ff62ca5
prep changelog
ccoffrin Oct 21, 2021
c37221c
add z i load conversion (#792)
jd-lara Oct 21, 2021
ddd4adf
minor update to changelog
ccoffrin Oct 21, 2021
74da2ca
Merge branch 'master' into rc-v0.19
ccoffrin Oct 25, 2021
e5734ea
Merge branch 'master' into rc-v0.20
ccoffrin Feb 13, 2022
400d370
update changelog
ccoffrin Feb 13, 2022
511a577
Updates for SCS v0.9 (#804)
ccoffrin Feb 13, 2022
4ba536b
merge latest master
ccoffrin Feb 14, 2022
4242266
merge latest changes on master
ccoffrin Feb 21, 2022
fb09720
Merge branch 'master' into rc-v0.20
ccoffrin Feb 28, 2022
8bcdf24
merge master updates from v0.19.3
ccoffrin Mar 3, 2022
555e9ef
merge latest from master
ccoffrin Mar 6, 2022
93907c5
fix changelog
ccoffrin Mar 6, 2022
18cab5f
update case5_pwlc to better test constant power functions
ccoffrin Mar 11, 2022
7796873
Merge branch 'master' into rc-v0.20
ccoffrin Aug 7, 2022
11caa1e
updates for revised test case and sdp solver variation
ccoffrin Aug 7, 2022
1505bee
Objective Function Building Rewrite (#836)
ccoffrin Aug 7, 2022
ef79c7e
drop support for jump v0.22, v0.23, update to scs v1.1
ccoffrin Aug 7, 2022
151888f
drop old json versions
ccoffrin Aug 7, 2022
dabb429
update changelog
ccoffrin Aug 7, 2022
904f0b0
Update to use two sided constraints (#838)
ccoffrin Aug 14, 2022
62d9dc7
merge latest master
ccoffrin Aug 14, 2022
4da2510
merge latest verion of master
ccoffrin Jan 1, 2024
bb1c116
merge master
ccoffrin Jan 1, 2024
e6b5a49
drop support for run functions, closes #878
ccoffrin Jan 1, 2024
8ebecd7
drop support for multiconductor, closes #872
ccoffrin Jan 1, 2024
c8656dc
update modeling of current limit constraints, closes #625
ccoffrin Jan 1, 2024
14282c9
remove conductors logic from data processing functions
ccoffrin Jan 2, 2024
01ba4a1
prep for release
ccoffrin Jan 2, 2024
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
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ PowerModels.jl Change Log
### Staged
- nothing

### v0.20.0
- Add support for models with mixtures of PWL and polynomial cost functions (#829)
- Revised models to use two-sided constraints (#819) (breaking)
- Rewrite code for building objective functions (#778) (breaking)
- Made current limit modeling consistent with thermal limit modeling (#625) (breaking)
- Drop support for multiple conductors (#872) (breaking)
- Drop support for `run_*` functions (#878) (breaking)
- Drop support for JuMP v0.22 and v0.23 (breaking)
- Drop support for JSON v0.18, v0.19, v0.20 (breaking)

### v0.19.10
- Add support for ACP and DCP formulation in OPF with PST variables (#543,#875)
- Fix implementation of `calc_theta_delta_bounds` when conductor parameter is used (#870)
Expand Down Expand Up @@ -33,6 +43,13 @@ PowerModels.jl Change Log
- Add support for JuMP v1.0
- Update `correct_cost_functions!` to support PWL costs with a constant power value

### v0.20.0
- Added conversion of impedance and current loads from PSSE raw files into constant power loads (#792)
- Made case name recovery optional in PTI parsing

### Staged
- nothing

### v0.19.4
- Fix `sol_component_value_edge` implementation and usage (#811)

Expand Down
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "PowerModels"
uuid = "c36e90e8-916a-50a6-bd94-075b64ef4655"
authors = ["Carleton Coffrin"]
repo = "https://github.com/lanl-ansi/PowerModels.jl"
version = "0.19.10"
version = "0.20.0"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
Expand All @@ -14,12 +14,12 @@ NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
HiGHS = "~0.3, ~1"
HiGHS = "~1"
InfrastructureModels = "~0.6, ~0.7"
Ipopt = "~0.8, ~0.9, ~1"
JSON = "~0.18, ~0.19, ~0.20, ~0.21"
JuMP = "~0.22, ~0.23, 1"
Juniper = "~0.8, ~0.9"
Ipopt = "~1"
JSON = "~0.21"
JuMP = "1"
Juniper = "~0.9"
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
NLsolve = "4.0"
SCS = "~0.9, ~1.0, ~2.0"
Expand Down
109 changes: 0 additions & 109 deletions src/PowerModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,115 +85,6 @@ include("prob/test.jl")
include("util/obbt.jl")
include("util/flow_limit_cuts.jl")


# function deprecation warnings
# can be removed in a breaking release after 09/01/2022
function run_model(args...; kwargs...)
@warn("the function run_model has been replaced with solve_model", maxlog=1)
solve_model(args...; kwargs...)
end

function run_pf(args...; kwargs...)
@warn("the function run_pf has been replaced with solve_pf", maxlog=1)
solve_pf(args...; kwargs...)
end
function run_ac_pf(args...; kwargs...)
@warn("the function run_ac_pf has been replaced with solve_ac_pf", maxlog=1)
solve_ac_pf(args...; kwargs...)
end
function run_dc_pf(args...; kwargs...)
@warn("the function run_dc_pf has been replaced with solve_dc_pf", maxlog=1)
solve_dc_pf(args...; kwargs...)
end
function run_pf_bf(args...; kwargs...)
@warn("the function run_pf_bf has been replaced with solve_pf_bf", maxlog=1)
solve_pf_bf(args...; kwargs...)
end
function run_pf_iv(args...; kwargs...)
@warn("the function run_pf_iv has been replaced with solve_pf_iv", maxlog=1)
solve_pf_iv(args...; kwargs...)
end


function run_opf(args...; kwargs...)
@warn("the function run_opf has been replaced with solve_opf", maxlog=1)
solve_opf(args...; kwargs...)
end
function run_ac_opf(args...; kwargs...)
@warn("the function run_ac_opf has been replaced with solve_ac_opf", maxlog=1)
solve_ac_opf(args...; kwargs...)
end
function run_dc_opf(args...; kwargs...)
@warn("the function run_dc_opf has been replaced with solve_dc_opf", maxlog=1)
solve_dc_opf(args...; kwargs...)
end

function run_mn_opf(args...; kwargs...)
@warn("the function run_mn_opf has been replaced with solve_mn_opf", maxlog=1)
solve_mn_opf(args...; kwargs...)
end
function run_mn_opf_strg(args...; kwargs...)
@warn("the function run_mn_opf_strg has been replaced with solve_mn_opf_strg", maxlog=1)
solve_mn_opf_strg(args...; kwargs...)
end
function run_opf_ptdf(args...; kwargs...)
@warn("the function run_opf_ptdf has been replaced with solve_opf_ptdf", maxlog=1)
solve_opf_ptdf(args...; kwargs...)
end

function run_opf_bf(args...; kwargs...)
@warn("the function run_opf_bf has been replaced with solve_opf_bf", maxlog=1)
solve_opf_bf(args...; kwargs...)
end
function run_mn_opf_bf_strg(args...; kwargs...)
@warn("the function run_mn_opf_bf_strg has been replaced with solve_mn_opf_bf_strg", maxlog=1)
solve_mn_opf_bf_strg(args...; kwargs...)
end
function run_opf_iv(args...; kwargs...)
@warn("the function run_opf_iv has been replaced with solve_opf_iv", maxlog=1)
solve_opf_iv(args...; kwargs...)
end

function run_opb(args...; kwargs...)
@warn("the function run_opb has been replaced with solve_opb", maxlog=1)
solve_opb(args...; kwargs...)
end
function run_nfa_opb(args...; kwargs...)
@warn("the function run_nfa_opb has been replaced with solve_nfa_opb", maxlog=1)
solve_nfa_opb(args...; kwargs...)
end

function run_ots(args...; kwargs...)
@warn("the function run_ots has been replaced with solve_ots", maxlog=1)
solve_ots(args...; kwargs...)
end
function run_tnep(args...; kwargs...)
@warn("the function run_tnep has been replaced with solve_tnep", maxlog=1)
solve_tnep(args...; kwargs...)
end

function run_opf_branch_power_cuts(args...; kwargs...)
@warn("the function run_opf_branch_power_cuts has been replaced with solve_opf_branch_power_cuts", maxlog=1)
solve_opf_branch_power_cuts(args...; kwargs...)
end
function run_opf_branch_power_cuts!(args...; kwargs...)
@warn("the function run_opf_branch_power_cuts! has been replaced with solve_opf_branch_power_cuts!", maxlog=1)
solve_opf_branch_power_cuts!(args...; kwargs...)
end
function run_opf_ptdf_branch_power_cuts(args...; kwargs...)
@warn("the function run_opf_ptdf_branch_power_cuts has been replaced with solve_opf_ptdf_branch_power_cuts", maxlog=1)
solve_opf_ptdf_branch_power_cuts(args...; kwargs...)
end
function run_opf_ptdf_branch_power_cuts!(args...; kwargs...)
@warn("the function run_opf_ptdf_branch_power_cuts! has been replaced with solve_opf_ptdf_branch_power_cuts!", maxlog=1)
solve_opf_ptdf_branch_power_cuts!(args...; kwargs...)
end
function run_obbt_opf!(args...; kwargs...)
@warn("the function run_obbt_opf! has been replaced with solve_obbt_opf!", maxlog=1)
solve_obbt_opf!(args...; kwargs...)
end


# this must come last to support automated export
include("core/export.jl")

Expand Down
19 changes: 2 additions & 17 deletions src/core/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@ _IM.@def pm_fields begin
end


""
ismulticonductor(pm::AbstractPowerModel, nw::Int) = haskey(pm.ref[:it][pm_it_sym][:nw][nw], :conductors)
ismulticonductor(pm::AbstractPowerModel; nw::Int=nw_id_default) = haskey(pm.ref[:it][pm_it_sym][:nw][nw], :conductors)

""
conductor_ids(pm::AbstractPowerModel, nw::Int) = pm.ref[:it][pm_it_sym][:nw][nw][:conductor_ids]
conductor_ids(pm::AbstractPowerModel; nw::Int=nw_id_default) = pm.ref[:it][pm_it_sym][:nw][nw][:conductor_ids]


""
function solve_model(file::String, model_type::Type, optimizer, build_method; kwargs...)
data = PowerModels.parse_file(file)
Expand All @@ -30,20 +21,14 @@ end
""
function solve_model(data::Dict{String,<:Any}, model_type::Type, optimizer, build_method;
ref_extensions=[], solution_processors=[], relax_integrality=false,
multinetwork=false, multiconductor=false, kwargs...)
multinetwork=false, kwargs...)

if multinetwork != _IM.ismultinetwork(data)
model_requirement = multinetwork ? "multi-network" : "single-network"
data_type = _IM.ismultinetwork(data) ? "multi-network" : "single-network"
Memento.error(_LOGGER, "attempted to build a $(model_requirement) model with $(data_type) data")
end

if multiconductor != ismulticonductor(data)
model_requirement = multiconductor ? "multi-conductor" : "single-conductor"
data_type = ismulticonductor(data) ? "multi-conductor" : "single-conductor"
Memento.error(_LOGGER, "attempted to build a $(model_requirement) model with $(data_type) data")
end

start_time = time()
pm = instantiate_model(data, model_type, build_method; ref_extensions=ref_extensions, kwargs...)
Memento.debug(_LOGGER, "pm model build time: $(time() - start_time)")
Expand Down Expand Up @@ -199,7 +184,7 @@ function ref_add_core!(ref::Dict{Symbol,Any})

### aggregate info for pairs of connected buses ###
if !haskey(nw_ref, :buspairs)
nw_ref[:buspairs] = calc_buspair_parameters(nw_ref[:bus], nw_ref[:branch], nw_ref[:conductor_ids], haskey(nw_ref, :conductors))
nw_ref[:buspairs] = calc_buspair_parameters(nw_ref[:bus], nw_ref[:branch])
end
end
end
Expand Down
20 changes: 15 additions & 5 deletions src/core/constraint_template.jl
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,27 @@ end

### Branch - Current Limit Constraints ###

"""
Adds a current magnitude limit constraint for the desired branch to the PowerModel.
"""
function constraint_current_limit(pm::AbstractPowerModel, i::Int; nw::Int=nw_id_default)
""
function constraint_current_limit_from(pm::AbstractPowerModel, i::Int; nw::Int=nw_id_default)
branch = ref(pm, nw, :branch, i)
f_bus = branch["f_bus"]
t_bus = branch["t_bus"]
f_idx = (i, f_bus, t_bus)

if haskey(branch, "c_rating_a")
constraint_current_limit(pm, nw, f_idx, branch["c_rating_a"])
constraint_current_limit_from(pm, nw, f_idx, branch["c_rating_a"])
end
end

""
function constraint_current_limit_to(pm::AbstractPowerModel, i::Int; nw::Int=nw_id_default)
branch = ref(pm, nw, :branch, i)
f_bus = branch["f_bus"]
t_bus = branch["t_bus"]
t_idx = (i, t_bus, f_bus)

if haskey(branch, "c_rating_a")
constraint_current_limit_to(pm, nw, t_idx, branch["c_rating_a"])
end
end

Expand Down
Loading
Loading