Skip to content

Commit

Permalink
add methods and types
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Jan 23, 2024
1 parent a0a5624 commit a22a04b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
24 changes: 21 additions & 3 deletions src/PowerFlowData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ struct PowerFlowData{
neighbors::Vector{Set{Int}}
end

get_bus_lookup(pfd::PowerFlowData) = pfd.bus_lookup
get_branch_lookup(pfd::PowerFlowData) = pfd.branch_lookup
get_bus_activepower_injection(pfd::PowerFlowData) = pfd.bus_activepower_injection
get_bus_reactivepower_injection(pfd::PowerFlowData) = pfd.bus_reactivepower_injection
get_bus_activepower_withdrawals(pfd::PowerFlowData) = pfd.bus_activepower_withdrawals
get_bus_reactivepower_withdrawals(pfd::PowerFlowData) = pfd.bus_reactivepower_withdrawals
get_bus_reactivepower_bounds(pfd::PowerFlowData) = pfd.bus_reactivepower_bounds
get_bus_type(pfd::PowerFlowData) = pfd.bus_type
get_branch_type(pfd::PowerFlowData) = pfd.branch_type
get_bus_magnitude(pfd::PowerFlowData) = pfd.bus_magnitude
get_bus_angles(pfd::PowerFlowData) = pfd.bus_angles
get_branch_flow_values(pfd::PowerFlowData) = pfd.branch_flow_values
get_timestep_map(pfd::PowerFlowData) = pfd.timestep_map
get_valid_ix(pfd::PowerFlowData) = pfd.valid_ix
get_power_network_matrix(pfd::PowerFlowData) = pfd.power_network_matrix
get_aux_network_matrix(pfd::PowerFlowData) = pfd.aux_network_matrix
get_neighbor(pfd::PowerFlowData) = pfd.neighbors

Check warning on line 90 in src/PowerFlowData.jl

View check run for this annotation

Codecov / codecov/patch

src/PowerFlowData.jl#L74-L90

Added lines #L74 - L90 were not covered by tests

# AC Power Flow Data
# TODO -> MULTI PERIOD: AC Power Flow Data
function _calculate_neighbors(
Expand Down Expand Up @@ -288,7 +306,7 @@ function PowerFlowData(
)

branch_types = Vector{DataType}(undef, length(branch_lookup))
for (ix, b) in enumerate(PNM.get_ac_branches(sys))
for (ix, b) in enumerate(PNM.get_ac_branches(sys))
branch_types[ix] = typeof(b)
end

Expand Down Expand Up @@ -423,7 +441,7 @@ function PowerFlowData(
)

branch_types = Vector{DataType}(undef, length(branch_lookup))
for (ix, b) in enumerate(PNM.get_ac_branches(sys))
for (ix, b) in enumerate(PNM.get_ac_branches(sys))
branch_types[ix] = typeof(b)
end

Expand Down Expand Up @@ -558,7 +576,7 @@ function PowerFlowData(
)

branch_types = Vector{DataType}(undef, length(branch_lookup))
for (ix, b) in enumerate(PNM.get_ac_branches(sys))
for (ix, b) in enumerate(PNM.get_ac_branches(sys))
branch_types[ix] = typeof(b)
end

Expand Down
4 changes: 2 additions & 2 deletions src/powerflow_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Base.@kwdef struct ACPowerFlow <: PowerFlowEvaluationModel
end

struct DCPowerFlow <: PowerFlowEvaluationModel end
struct PTDFDCPowerFlow <: PowerFlowEvaluationModel end
struct vPTDFDCPowerFlow <: PowerFlowEvaluationModel end
struct PTDFDCPowerFlow <: PowerFlowEvaluationModel end
struct vPTDFDCPowerFlow <: PowerFlowEvaluationModel end

0 comments on commit a22a04b

Please sign in to comment.