Skip to content

Commit bf46c28

Browse files
ccoffrinjd-lara
andauthored
Breaking Updates for v0.20 Release (#900)
* add z i load conversion (#792) * update case5_pwlc to better test constant power functions * updates for revised test case and sdp solver variation * Objective Function Building Rewrite (#836) * tests passing, closes #778, closes #829 * add test for mixed mode cost data * note to change log * drop support for jump v0.22, v0.23, update to scs v2 * drop old json versions * Update to use two sided constraints (#838) * closes #819 * drop support for run functions, closes #878 * drop support for multiconductor, closes #872 * update modeling of current limit constraints, closes #625 * remove conductors logic from data processing functions * prep for release v0.20.0 --------- Co-authored-by: Jose Daniel Lara <[email protected]>
1 parent 010b6ee commit bf46c28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1065
-1579
lines changed

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ PowerModels.jl Change Log
44
### Staged
55
- nothing
66

7+
### v0.20.0
8+
- Add support for models with mixtures of PWL and polynomial cost functions (#829)
9+
- Revised models to use two-sided constraints (#819) (breaking)
10+
- Rewrite code for building objective functions (#778) (breaking)
11+
- Made current limit modeling consistent with thermal limit modeling (#625) (breaking)
12+
- Drop support for multiple conductors (#872) (breaking)
13+
- Drop support for `run_*` functions (#878) (breaking)
14+
- Drop support for JuMP v0.22 and v0.23 (breaking)
15+
- Drop support for JSON v0.18, v0.19, v0.20 (breaking)
16+
717
### v0.19.10
818
- Add support for ACP and DCP formulation in OPF with PST variables (#543,#875)
919
- Fix implementation of `calc_theta_delta_bounds` when conductor parameter is used (#870)
@@ -33,6 +43,13 @@ PowerModels.jl Change Log
3343
- Add support for JuMP v1.0
3444
- Update `correct_cost_functions!` to support PWL costs with a constant power value
3545

46+
### v0.20.0
47+
- Added conversion of impedance and current loads from PSSE raw files into constant power loads (#792)
48+
- Made case name recovery optional in PTI parsing
49+
50+
### Staged
51+
- nothing
52+
3653
### v0.19.4
3754
- Fix `sol_component_value_edge` implementation and usage (#811)
3855

Project.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "PowerModels"
22
uuid = "c36e90e8-916a-50a6-bd94-075b64ef4655"
33
authors = ["Carleton Coffrin"]
44
repo = "https://github.com/lanl-ansi/PowerModels.jl"
5-
version = "0.19.10"
5+
version = "0.20.0"
66

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

1616
[compat]
17-
HiGHS = "~0.3, ~1"
17+
HiGHS = "~1"
1818
InfrastructureModels = "~0.6, ~0.7"
19-
Ipopt = "~0.8, ~0.9, ~1"
20-
JSON = "~0.18, ~0.19, ~0.20, ~0.21"
21-
JuMP = "~0.22, ~0.23, 1"
22-
Juniper = "~0.8, ~0.9"
19+
Ipopt = "~1"
20+
JSON = "~0.21"
21+
JuMP = "1"
22+
Juniper = "~0.9"
2323
Memento = "~1.0, ~1.1, ~1.2, ~1.3, ~1.4"
2424
NLsolve = "4.0"
2525
SCS = "~0.9, ~1.0, ~2.0"

src/PowerModels.jl

-109
Original file line numberDiff line numberDiff line change
@@ -85,115 +85,6 @@ include("prob/test.jl")
8585
include("util/obbt.jl")
8686
include("util/flow_limit_cuts.jl")
8787

88-
89-
# function deprecation warnings
90-
# can be removed in a breaking release after 09/01/2022
91-
function run_model(args...; kwargs...)
92-
@warn("the function run_model has been replaced with solve_model", maxlog=1)
93-
solve_model(args...; kwargs...)
94-
end
95-
96-
function run_pf(args...; kwargs...)
97-
@warn("the function run_pf has been replaced with solve_pf", maxlog=1)
98-
solve_pf(args...; kwargs...)
99-
end
100-
function run_ac_pf(args...; kwargs...)
101-
@warn("the function run_ac_pf has been replaced with solve_ac_pf", maxlog=1)
102-
solve_ac_pf(args...; kwargs...)
103-
end
104-
function run_dc_pf(args...; kwargs...)
105-
@warn("the function run_dc_pf has been replaced with solve_dc_pf", maxlog=1)
106-
solve_dc_pf(args...; kwargs...)
107-
end
108-
function run_pf_bf(args...; kwargs...)
109-
@warn("the function run_pf_bf has been replaced with solve_pf_bf", maxlog=1)
110-
solve_pf_bf(args...; kwargs...)
111-
end
112-
function run_pf_iv(args...; kwargs...)
113-
@warn("the function run_pf_iv has been replaced with solve_pf_iv", maxlog=1)
114-
solve_pf_iv(args...; kwargs...)
115-
end
116-
117-
118-
function run_opf(args...; kwargs...)
119-
@warn("the function run_opf has been replaced with solve_opf", maxlog=1)
120-
solve_opf(args...; kwargs...)
121-
end
122-
function run_ac_opf(args...; kwargs...)
123-
@warn("the function run_ac_opf has been replaced with solve_ac_opf", maxlog=1)
124-
solve_ac_opf(args...; kwargs...)
125-
end
126-
function run_dc_opf(args...; kwargs...)
127-
@warn("the function run_dc_opf has been replaced with solve_dc_opf", maxlog=1)
128-
solve_dc_opf(args...; kwargs...)
129-
end
130-
131-
function run_mn_opf(args...; kwargs...)
132-
@warn("the function run_mn_opf has been replaced with solve_mn_opf", maxlog=1)
133-
solve_mn_opf(args...; kwargs...)
134-
end
135-
function run_mn_opf_strg(args...; kwargs...)
136-
@warn("the function run_mn_opf_strg has been replaced with solve_mn_opf_strg", maxlog=1)
137-
solve_mn_opf_strg(args...; kwargs...)
138-
end
139-
function run_opf_ptdf(args...; kwargs...)
140-
@warn("the function run_opf_ptdf has been replaced with solve_opf_ptdf", maxlog=1)
141-
solve_opf_ptdf(args...; kwargs...)
142-
end
143-
144-
function run_opf_bf(args...; kwargs...)
145-
@warn("the function run_opf_bf has been replaced with solve_opf_bf", maxlog=1)
146-
solve_opf_bf(args...; kwargs...)
147-
end
148-
function run_mn_opf_bf_strg(args...; kwargs...)
149-
@warn("the function run_mn_opf_bf_strg has been replaced with solve_mn_opf_bf_strg", maxlog=1)
150-
solve_mn_opf_bf_strg(args...; kwargs...)
151-
end
152-
function run_opf_iv(args...; kwargs...)
153-
@warn("the function run_opf_iv has been replaced with solve_opf_iv", maxlog=1)
154-
solve_opf_iv(args...; kwargs...)
155-
end
156-
157-
function run_opb(args...; kwargs...)
158-
@warn("the function run_opb has been replaced with solve_opb", maxlog=1)
159-
solve_opb(args...; kwargs...)
160-
end
161-
function run_nfa_opb(args...; kwargs...)
162-
@warn("the function run_nfa_opb has been replaced with solve_nfa_opb", maxlog=1)
163-
solve_nfa_opb(args...; kwargs...)
164-
end
165-
166-
function run_ots(args...; kwargs...)
167-
@warn("the function run_ots has been replaced with solve_ots", maxlog=1)
168-
solve_ots(args...; kwargs...)
169-
end
170-
function run_tnep(args...; kwargs...)
171-
@warn("the function run_tnep has been replaced with solve_tnep", maxlog=1)
172-
solve_tnep(args...; kwargs...)
173-
end
174-
175-
function run_opf_branch_power_cuts(args...; kwargs...)
176-
@warn("the function run_opf_branch_power_cuts has been replaced with solve_opf_branch_power_cuts", maxlog=1)
177-
solve_opf_branch_power_cuts(args...; kwargs...)
178-
end
179-
function run_opf_branch_power_cuts!(args...; kwargs...)
180-
@warn("the function run_opf_branch_power_cuts! has been replaced with solve_opf_branch_power_cuts!", maxlog=1)
181-
solve_opf_branch_power_cuts!(args...; kwargs...)
182-
end
183-
function run_opf_ptdf_branch_power_cuts(args...; kwargs...)
184-
@warn("the function run_opf_ptdf_branch_power_cuts has been replaced with solve_opf_ptdf_branch_power_cuts", maxlog=1)
185-
solve_opf_ptdf_branch_power_cuts(args...; kwargs...)
186-
end
187-
function run_opf_ptdf_branch_power_cuts!(args...; kwargs...)
188-
@warn("the function run_opf_ptdf_branch_power_cuts! has been replaced with solve_opf_ptdf_branch_power_cuts!", maxlog=1)
189-
solve_opf_ptdf_branch_power_cuts!(args...; kwargs...)
190-
end
191-
function run_obbt_opf!(args...; kwargs...)
192-
@warn("the function run_obbt_opf! has been replaced with solve_obbt_opf!", maxlog=1)
193-
solve_obbt_opf!(args...; kwargs...)
194-
end
195-
196-
19788
# this must come last to support automated export
19889
include("core/export.jl")
19990

src/core/base.jl

+2-17
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ _IM.@def pm_fields begin
1212
end
1313

1414

15-
""
16-
ismulticonductor(pm::AbstractPowerModel, nw::Int) = haskey(pm.ref[:it][pm_it_sym][:nw][nw], :conductors)
17-
ismulticonductor(pm::AbstractPowerModel; nw::Int=nw_id_default) = haskey(pm.ref[:it][pm_it_sym][:nw][nw], :conductors)
18-
19-
""
20-
conductor_ids(pm::AbstractPowerModel, nw::Int) = pm.ref[:it][pm_it_sym][:nw][nw][:conductor_ids]
21-
conductor_ids(pm::AbstractPowerModel; nw::Int=nw_id_default) = pm.ref[:it][pm_it_sym][:nw][nw][:conductor_ids]
22-
23-
2415
""
2516
function solve_model(file::String, model_type::Type, optimizer, build_method; kwargs...)
2617
data = PowerModels.parse_file(file)
@@ -30,20 +21,14 @@ end
3021
""
3122
function solve_model(data::Dict{String,<:Any}, model_type::Type, optimizer, build_method;
3223
ref_extensions=[], solution_processors=[], relax_integrality=false,
33-
multinetwork=false, multiconductor=false, kwargs...)
24+
multinetwork=false, kwargs...)
3425

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

41-
if multiconductor != ismulticonductor(data)
42-
model_requirement = multiconductor ? "multi-conductor" : "single-conductor"
43-
data_type = ismulticonductor(data) ? "multi-conductor" : "single-conductor"
44-
Memento.error(_LOGGER, "attempted to build a $(model_requirement) model with $(data_type) data")
45-
end
46-
4732
start_time = time()
4833
pm = instantiate_model(data, model_type, build_method; ref_extensions=ref_extensions, kwargs...)
4934
Memento.debug(_LOGGER, "pm model build time: $(time() - start_time)")
@@ -199,7 +184,7 @@ function ref_add_core!(ref::Dict{Symbol,Any})
199184

200185
### aggregate info for pairs of connected buses ###
201186
if !haskey(nw_ref, :buspairs)
202-
nw_ref[:buspairs] = calc_buspair_parameters(nw_ref[:bus], nw_ref[:branch], nw_ref[:conductor_ids], haskey(nw_ref, :conductors))
187+
nw_ref[:buspairs] = calc_buspair_parameters(nw_ref[:bus], nw_ref[:branch])
203188
end
204189
end
205190
end

src/core/constraint_template.jl

+15-5
Original file line numberDiff line numberDiff line change
@@ -697,17 +697,27 @@ end
697697

698698
### Branch - Current Limit Constraints ###
699699

700-
"""
701-
Adds a current magnitude limit constraint for the desired branch to the PowerModel.
702-
"""
703-
function constraint_current_limit(pm::AbstractPowerModel, i::Int; nw::Int=nw_id_default)
700+
""
701+
function constraint_current_limit_from(pm::AbstractPowerModel, i::Int; nw::Int=nw_id_default)
704702
branch = ref(pm, nw, :branch, i)
705703
f_bus = branch["f_bus"]
706704
t_bus = branch["t_bus"]
707705
f_idx = (i, f_bus, t_bus)
708706

709707
if haskey(branch, "c_rating_a")
710-
constraint_current_limit(pm, nw, f_idx, branch["c_rating_a"])
708+
constraint_current_limit_from(pm, nw, f_idx, branch["c_rating_a"])
709+
end
710+
end
711+
712+
""
713+
function constraint_current_limit_to(pm::AbstractPowerModel, i::Int; nw::Int=nw_id_default)
714+
branch = ref(pm, nw, :branch, i)
715+
f_bus = branch["f_bus"]
716+
t_bus = branch["t_bus"]
717+
t_idx = (i, t_bus, f_bus)
718+
719+
if haskey(branch, "c_rating_a")
720+
constraint_current_limit_to(pm, nw, t_idx, branch["c_rating_a"])
711721
end
712722
end
713723

0 commit comments

Comments
 (0)