Skip to content

Commit

Permalink
Fix type ambiguities
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-thom committed Sep 21, 2023
1 parent d950412 commit 0eacd45
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ function construct_device!(
::OptimizationContainer,
::PSY.System,
::ArgumentConstructStage,
::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded},
::DeviceModel{T, HVDCTwoTerminalUnbounded},
::NetworkModel{<:PM.AbstractPowerModel},
)
) where {T <: TwoTerminalHVDCTypes}
return
end

Expand All @@ -433,15 +433,12 @@ function construct_device!(
container::OptimizationContainer,
sys::PSY.System,
::ArgumentConstructStage,
model::DeviceModel{T, U},
model::DeviceModel{T, HVDCTwoTerminalUnbounded},
network_model::NetworkModel{<:Union{StandardPTDFModel, PTDFPowerModel}},
) where {
T <: TwoTerminalHVDCTypes,
U <: HVDCTwoTerminalUnbounded,
}
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(T, sys, get_attribute(model, "filter_function"))
add_variables!(container, FlowActivePowerVariable, devices, U())
add_variables!(container, FlowActivePowerVariable, devices, HVDCTwoTerminalUnbounded())
add_to_expression!(
container,
ActivePowerBalance,
Expand All @@ -458,7 +455,7 @@ function construct_device!(
container::OptimizationContainer,
sys::PSY.System,
::ModelConstructStage,
model::DeviceModel{<:TwoTerminalHVDCTypes, <:HVDCTwoTerminalUnbounded},
model::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalUnbounded},
network_model::NetworkModel{<:Union{StandardPTDFModel, PTDFPowerModel}},
)
add_constraint_dual!(container, sys, model)
Expand All @@ -469,9 +466,9 @@ function construct_device!(
::OptimizationContainer,
::PSY.System,
::ArgumentConstructStage,
::DeviceModel{<:TwoTerminalHVDCTypes, HVDCTwoTerminalLossless},
::DeviceModel{T, HVDCTwoTerminalLossless},
::NetworkModel{<:PM.AbstractPowerModel},
)
) where {T <: TwoTerminalHVDCTypes}
return
end

Expand All @@ -494,12 +491,12 @@ function construct_device!(
container::OptimizationContainer,
sys::PSY.System,
::ArgumentConstructStage,
model::DeviceModel{T, U},
model::DeviceModel{T, HVDCTwoTerminalLossless},
network_model::NetworkModel{<:Union{StandardPTDFModel, PTDFPowerModel}},
) where {T <: TwoTerminalHVDCTypes, U <: HVDCTwoTerminalLossless}
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(T, sys, get_attribute(model, "filter_function"))
add_variables!(container, FlowActivePowerVariable, devices, U())
add_variables!(container, FlowActivePowerVariable, devices, HVDCTwoTerminalLossless())
add_to_expression!(
container,
ActivePowerBalance,
Expand Down

0 comments on commit 0eacd45

Please sign in to comment.