Input validators and Network builders

CommonOPF.format_input_dictFunction
function format_input_dict(d::Dict)::Dict

Convert busses from Vector{String} to Tuple{String, String} for all edge types

source

Subtypes of AbstractBus

CommonOPF.build_bussesFunction
function  build_busses(dicts::AbstractVector{Dict{Symbol, Any}}, ConcreteBusType::DataType)

unpack each dict in dicts into ConcreteBusType constructor and pass the results to check_edges!.

returns Vector{ConcreteBusType}

source
CommonOPF.check_busses!Function
check_busses!(busses::AbstractVector{<:AbstractBus}) = nothing

The default action after build_busses.

source
check_busses!(loads::AbstractVector{Load})

Remove (and warn about it) if any Load have no way to define the loads

source
CommonOPF.fill_node_attributes!Function
fill_node_attributes!(g::MetaGraphsNext.AbstractGraph, vals::AbstractVector{<:AbstractBus})

For each concrete bus in vals store the concrete bus in the graph at concrete_bus.node.

source
CommonOPF.fill_load!Function

Rules:

  1. If q_to_p is defined and a kwsN value is defined then we fill the kvarN value, where $N \in {1,2,3}$.
source

Subtypes of AbstractEdge

CommonOPF.build_edgesFunction
function build_edges(dicts::AbstractVector{Dict}, Edge::DataType)

unpack each dict in dicts into Edge and pass the results to check_edges!. returns Vector{Edge}

source
CommonOPF.check_edges!Function
check_edges!(edges::AbstractVector{<:AbstractEdge})::Bool = true

The default action after build_edges.

source
check_edges!(conductors::AbstractVector{Conductor})

if all phases are missing then - warn_singlephase_conductors_and_copy_templates(conductors) else - validate_multiphase_edges!(conductors)

source
check_edges!(transformers::AbstractVector{Transformer})::Bool

fill in rmatrix and xmatrix if phases is not missing. For now assuming zero mutual impedances.

source
check_edges!(regulators::AbstractVector{VoltageRegulator})::Bool

Warn if not missing both vregpu and turnratio and call validatemultiphaseedges! if any phases are not missing.

source
CommonOPF.fill_edges!Function
function fill_edges!(g::MetaGraphsNext.AbstractGraph, vals::AbstractVector{<:AbstractEdge})

For each edgeinvalsstore theedge`in the graph using theedge.busses`:

b1, b2 = edge.busses
graph[b1, b2] = edge

Existing edges are overwritten with a warning.

source
CommonOPF.fill_impedance_matrices!Function
function fill_impedance_matrices!(edge::AbstractEdge)

Put the resistance and reactance values on the diagonal of the rmatrix and xmatrix respectively

source
function fill_impedance_matrices!(cond::Conductor)

Use zero and positive sequence impedances to create phase-impedance matrix.

source
CommonOPF.unpack_input_matrices!Function
function unpack_input_matrices!(edge::AbstractEdge)

Convert lower diagonal impedance matrices loaded in from YAML or JSON to 3x3 matrices. The "matrices" come in as Vector{Vector} and look like:

julia> d[:conductors][3][:rmatrix]
3-element Vector{Vector{Float64}}:
 [0.31]
 [0.15, 0.32]
 [0.15, 0.15, 0.33]
source
CommonOPF.validate_multiphase_edges!Function
validate_multiphase_edges!(edges::AbstractVector{<:AbstractEdge})

The default method for checking for missing phases and filling rmatrix and xmatrix values for subtypes of AbstractEdge. We assume that the subtype has resistance and reactance properties and warn if any phases are missing as well as if we cannot infer impedance values.

source
validate_multiphase_edges!(conds::AbstractVector{Conductor})::Bool

Fill in impedance matrices and @warn for any conductors that do not have inputs required to define impedance.

source