Skip to content

Commit

Permalink
UPD: Julia v1.6 (LTS), JuMP v0.23 (#39)
Browse files Browse the repository at this point in the history
* RM: duplcate of add_ct in components.jl

* REF: move data functions to data_model

* UPD: Julia v1.6 (LTS) min

* UPD: JuMP v0.23, compat formatting

* v0.5.1 release prep

* UPD: Int64 to Int
  • Loading branch information
pseudocubic authored Mar 15, 2022
1 parent 23f530f commit 2f65565
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1.6'
- '1'
- 'nightly'
os:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

- none

## v0.5.1

- Removed duplicate `add_ct` function
- Refactored to move data functions to data_model folder
- Updated support to JuMP v0.23
- Updated to minimum Julia v1.6 (LTS)

## v0.5.0

- Added support for PowerModelsDistribution 0.14
Expand Down
16 changes: 8 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PowerModelsProtection"
uuid = "719c1aef-945b-435a-a240-4c2992e5e0df"
authors = ["Art Barnes", "Jose Tabarez"]
version = "0.5.0"
version = "0.5.1"

[deps]
InfrastructureModels = "2030c09a-7f63-5d83-885d-db604e0e9cc0"
Expand All @@ -13,13 +13,13 @@ PowerModelsDistribution = "d7431456-977f-11e9-2de3-97ff7677985e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[compat]
InfrastructureModels = "~0.7.2"
Ipopt = "~0.9"
JuMP = "~0.22"
Graphs = "~1.4.1"
PowerModels = "~0.19.1"
PowerModelsDistribution = "~0.13.3, ~0.14"
julia = "^1"
InfrastructureModels = "0.7.3"
Ipopt = "0.9, 1.0.2"
JuMP = "0.22, 0.23"
Graphs = "1.4.1, 1.6"
PowerModels = "0.19.1"
PowerModelsDistribution = "~0.13.3, 0.14"
julia = "1.6"

[extras]
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
Expand Down
11 changes: 5 additions & 6 deletions src/PowerModelsProtection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ module PowerModelsProtection
include("data_model/components.jl")
include("data_model/eng2math.jl")
include("data_model/math2eng.jl")
include("data_model/helper_functions.jl")
include("data_model/operation.jl")
include("data_model/cts.jl")
include("data_model/fuses.jl")
include("data_model/relays.jl")

include("io/common.jl")
include("io/dss/dss2eng.jl")
Expand All @@ -38,11 +43,5 @@ module PowerModelsProtection
include("prob/fs_mc.jl")
include("prob/pf_mc.jl")

include("core/helper_functions.jl")
include("core/operation.jl")
include("core/fuses.jl")
include("core/relays.jl")
include("core/cts.jl")

include("core/export.jl") # must be last include to properly export functions
end
36 changes: 0 additions & 36 deletions src/data_model/components.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,42 +224,6 @@ function add_fault!(data::Dict{String,Any}, name::String, type::String, bus::Str
end


"""
add_ct(data::Dict{String,Any}, element::String, id::String, n_p::Number, n_s::Number;kwargs...)
Function to add current transformer to circuit.
Inputs 4 if adding first CT, 5 otherwise:
(1) data(Dictionary): Result from parse_file(). Circuit information
(2) element(String): Element or line that CT is being added to
(3) id(String): Optional. For multiple CT on the same line. If not used overwrites previously defined CT1
(4) n_p(Number): Primary . Would be the number of of the relay side of transformer
(5) n_s(Number): Secondary . Number of on line side
(6) kwargs: Any other information user wants to add. Not used by anything.
"""
function add_ct(data::Dict{String,Any}, element::Union{String,SubString{String}}, id::Union{String,SubString{String}}, n_p::Number, n_s::Number;kwargs...)
if !haskey(data, "protection")
data["protection"] = Dict{String,Any}()
end
if haskey(data["line"], "$element")
if !haskey(data["protection"], "C_Transformers")
data["protection"]["C_Transformers"] = Dict{String,Any}()
end
if haskey(data["protection"]["C_Transformers"], "$id")
@info "$id has been redefined"
end
data["protection"]["C_Transformers"]["$id"] = Dict{String,Any}(
"turns" => [n_p,n_s],
"element" => element
)
kwargs_dict = Dict(kwargs)
new_dict = _add_dict(kwargs_dict)
merge!(data["protection"]["C_Transformers"]["$id"], new_dict)
else
@info "Circuit element $element does not exist. No CT added."
end
end


"""
_non_ideal_ct(relay_data,CT_data,Iabc)
Expand Down
13 changes: 9 additions & 4 deletions src/core/cts.jl → src/data_model/cts.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
"""
Function to add a current transformer to circuit dictionary.
add_ct(data::Dict{String,Any}, element::String, id::String, n_p::Number, n_s::Number;kwargs...)
Inputs(in order):
Circuit dictionary, monitored element, name of fuse, primary and secondary turns. Turns entered seperately and stored as a vector.
Function to add current transformer to circuit.
Inputs 4 if adding first CT, 5 otherwise:
(1) data(Dictionary): Result from parse_file(). Circuit information
(2) element(String): Element or line that CT is being added to
(3) id(String): Optional. For multiple CT on the same line. If not used overwrites previously defined CT1
(4) n_p(Number): Primary . Would be the number of of the relay side of transformer
(5) n_s(Number): Secondary . Number of on line side
(6) kwargs: Any other information user wants to add. Not used by anything.
"""
function add_ct(data::Dict{String,Any}, element::Union{String,SubString{String}}, id::Union{String,SubString{String}}, n_p::Number, n_s::Number;kwargs...)
if !haskey(data, "protection")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

2 comments on commit 2f65565

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

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.5.1 -m "<description of version>" 2f65565c55e39672db522dd65b284436f10220dd
git push origin v0.5.1

Please sign in to comment.