Skip to content

Commit

Permalink
Updates for PowerModels v0.14 (#194)
Browse files Browse the repository at this point in the history
* update build_model to instantiate_model

* add optimizer kwarg to optimize_model

* update powermodels version in project

* update post_ methods to build_

* remove manifest from docs

* update powermodels version in docs project.toml

* UPD: Changelog and bump version to v0.7

Co-authored-by: David M Fobes <[email protected]>
  • Loading branch information
ccoffrin and pseudocubic committed Jan 24, 2020
1 parent cc5b09f commit 5eddee6
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 300 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ PowerModelsDistribution.jl Change Log
### staged
- none

### v0.7.0
- Updates function names for PowerModels v0.14 compatibility (breaking) (#194)

### v0.6.1
- Fixed bug with new default SCS settings causing tests to fail (#190)
- Changed unit test '5-bus independent radial different sdpubf opf_bf', testing vm instead of qg
Expand Down
4 changes: 2 additions & 2 deletions 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.6.1"
version = "0.7.0"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
Expand All @@ -21,7 +21,7 @@ JuMP = "~0.19.2, ~0.20"
Juniper = ">= 0.4"
MathOptInterface = "~0.8, ~0.9"
Memento = "~0.10, ~0.11, ~0.12"
PowerModels = "~0.13"
PowerModels = "~0.14"
SCS = ">= 0.4"
julia = "^1"

Expand Down
255 changes: 0 additions & 255 deletions docs/Manifest.toml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"

[compat]
InfrastructureModels = "~0.3"
PowerModels = "~0.13"
PowerModels = "~0.14"
4 changes: 2 additions & 2 deletions docs/src/quickguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The following example demonstrates how to break a `run_mc_opf` call into seperat

```julia
data = PowerModelsDistribution.parse_file("case3_unbalanced.dss")
pm = PowerModels.build_model(data, ACPPowerModel, PowerModelsDistribution.post_mc_opf; multiconductor=true)
pm = PowerModels.instantiate_model(data, ACPPowerModel, PowerModelsDistribution.build_mc_opf; multiconductor=true, ref_extensions=[ref_add_arcs_trans!])
print(pm.model)
optimize_model!(pm, with_optimizer(Ipopt.Optimizer))
optimize_model!(pm, optimizer=with_optimizer(Ipopt.Optimizer))
```
8 changes: 4 additions & 4 deletions src/prob/debug.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# that do not converge using the standard formulations
"OPF problem with slack power at every bus"
function run_mc_opf_pbs(data::Dict{String,Any}, model_type, solver; kwargs...)
return _PMs.run_model(data, model_type, solver, post_mc_opf_pbs; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_pbs!, kwargs...)
return _PMs.run_model(data, model_type, solver, build_mc_opf_pbs; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_pbs!, kwargs...)
end


Expand All @@ -14,7 +14,7 @@ end

"PF problem with slack power at every bus"
function run_mc_pf_pbs(data::Dict{String,Any}, model_type, solver; kwargs...)
return _PMs.run_model(data, model_type, solver, post_mc_pf_pbs; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_pbs!, kwargs...)
return _PMs.run_model(data, model_type, solver, build_mc_pf_pbs; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_pbs!, kwargs...)
end


Expand All @@ -25,7 +25,7 @@ end


"OPF problem with slack power at every bus"
function post_mc_opf_pbs(pm::_PMs.AbstractPowerModel)
function build_mc_opf_pbs(pm::_PMs.AbstractPowerModel)
variable_mc_voltage(pm)

variable_mc_branch_flow(pm)
Expand Down Expand Up @@ -60,7 +60,7 @@ end


"PF problem with slack power at every bus"
function post_mc_pf_pbs(pm::_PMs.AbstractPowerModel)
function build_mc_pf_pbs(pm::_PMs.AbstractPowerModel)
variable_mc_voltage(pm; bounded=false)

variable_mc_branch_flow(pm; bounded=false)
Expand Down
12 changes: 6 additions & 6 deletions src/prob/mld.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Run load shedding problem with storage"
function run_mc_mld(data::Dict{String,Any}, model_type, solver; kwargs...)
return _PMs.run_model(data, model_type, solver, post_mc_mld; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_mld!, kwargs...)
return _PMs.run_model(data, model_type, solver, build_mc_mld; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_mld!, kwargs...)
end


Expand All @@ -15,7 +15,7 @@ function run_mc_mld_bf(data::Dict{String,Any}, model_type, solver; kwargs...)
if model_type != LPLinUBFPowerModel
Memento.error(_LOGGER, "The problem type mc_mld_bf only supports a limited set of formulations at the moment")
end
return _PMs.run_model(data, model_type, solver, post_mc_mld_bf; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_mld_bf!, kwargs...)
return _PMs.run_model(data, model_type, solver, build_mc_mld_bf; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_mld_bf!, kwargs...)
end


Expand All @@ -27,7 +27,7 @@ end

"Run unit commitment load shedding problem (!relaxed)"
function run_mc_mld_uc(data::Dict{String,Any}, model_type, solver; kwargs...)
return _PMs.run_model(data, model_type, solver, post_mc_mld_uc; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_mld!, kwargs...)
return _PMs.run_model(data, model_type, solver, build_mc_mld_uc; multiconductor=true, ref_extensions=[ref_add_arcs_trans!], solution_builder=solution_mld!, kwargs...)
end


Expand All @@ -38,7 +38,7 @@ end


"Load shedding problem including storage"
function post_mc_mld(pm::_PMs.AbstractPowerModel)
function build_mc_mld(pm::_PMs.AbstractPowerModel)
variable_mc_indicator_bus_voltage(pm; relax=true)
variable_mc_bus_voltage_on_off(pm)

Expand Down Expand Up @@ -97,7 +97,7 @@ end


"Load shedding problem for Branch Flow model"
function post_mc_mld_bf(pm::_PMs.AbstractPowerModel)
function build_mc_mld_bf(pm::_PMs.AbstractPowerModel)
variable_mc_indicator_bus_voltage(pm; relax=true)
variable_mc_bus_voltage_on_off(pm)

Expand Down Expand Up @@ -146,7 +146,7 @@ end


"Standard unit commitment (!relaxed) load shedding problem"
function post_mc_mld_uc(pm::_PMs.AbstractPowerModel)
function build_mc_mld_uc(pm::_PMs.AbstractPowerModel)
variable_mc_indicator_bus_voltage(pm; relax=false)
variable_mc_bus_voltage_on_off(pm)

Expand Down
Loading

2 comments on commit 5eddee6

@pseudocubic
Copy link
Collaborator

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/8377

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 Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.0 -m "<description of version>" 5eddee6d187257c9429615ca37379b220dd96c9a
git push origin v0.7.0

Please sign in to comment.