Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Aug 6, 2024
1 parent 228ff3c commit 5662db1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 96 deletions.
39 changes: 13 additions & 26 deletions src/devices_models/device_constructors/branch_constructor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@ function construct_device!(
model::DeviceModel{T, StaticBranchBounds},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: PSY.ACBranch}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_constraints!(container, NetworkFlowConstraint, devices, model, network_model)
branch_rate_bounds!(
container,
Expand All @@ -347,8 +346,7 @@ function construct_device!(
model::DeviceModel{T, StaticBranchUnbounded},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: PSY.ACBranch}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_variables!(
container,
FlowActivePowerVariable,
Expand All @@ -367,8 +365,7 @@ function construct_device!(
model::DeviceModel{T, StaticBranchUnbounded},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: PSY.ACBranch}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_feedforward_constraints!(container, model, devices)
add_constraints!(container, NetworkFlowConstraint, devices, model, network_model)
add_constraint_dual!(container, sys, model)
Expand Down Expand Up @@ -405,8 +402,7 @@ function construct_device!(
model::DeviceModel{T, StaticBranch},
network_model::NetworkModel{<:PM.AbstractPowerModel},
) where {T <: PSY.ACBranch}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
branch_rate_bounds!(container, devices, model, network_model)
add_feedforward_constraints!(container, model, devices)
add_constraints!(container, RateLimitConstraintFromTo, devices, model, network_model)
Expand Down Expand Up @@ -553,8 +549,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalUnbounded},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_variables!(container, FlowActivePowerVariable, devices, HVDCTwoTerminalUnbounded())
add_to_expression!(
container,
Expand Down Expand Up @@ -596,8 +591,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalLossless},
network_model::NetworkModel{<:PM.AbstractPowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_constraints!(container, FlowRateConstraint, devices, model, network_model)
add_constraint_dual!(container, sys, model)
return
Expand All @@ -611,8 +605,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalLossless},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_variables!(container, FlowActivePowerVariable, devices, HVDCTwoTerminalLossless())
add_to_expression!(
container,
Expand All @@ -635,8 +628,7 @@ function construct_device!(
) where {
T <: TwoTerminalHVDCTypes,
}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_constraints!(container, FlowRateConstraint, devices, model, network_model)
add_constraint_dual!(container, sys, model)
return
Expand All @@ -649,8 +641,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalDispatch},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_variables!(
container,
FlowActivePowerToFromVariable,
Expand Down Expand Up @@ -699,8 +690,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalDispatch},
network_model::NetworkModel{<:AbstractPTDFModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_constraints!(container, FlowRateConstraintFromTo, devices, model, network_model)
add_constraints!(container, FlowRateConstraintToFrom, devices, model, network_model)
add_constraints!(container, HVDCPowerBalance, devices, model, network_model)
Expand All @@ -715,8 +705,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalDispatch},
network_model::NetworkModel{<:PM.AbstractActivePowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_variables!(
container,
FlowActivePowerToFromVariable,
Expand Down Expand Up @@ -757,8 +746,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalDispatch},
network_model::NetworkModel{CopperPlatePowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

Check warning on line 749 in src/devices_models/device_constructors/branch_constructor.jl

View check run for this annotation

Codecov / codecov/patch

src/devices_models/device_constructors/branch_constructor.jl#L749

Added line #L749 was not covered by tests
@warn "CopperPlatePowerModel models with HVDC ignores inter-area losses"
add_constraints!(container, FlowRateConstraintFromTo, devices, model, network_model)
add_constraints!(container, FlowRateConstraintToFrom, devices, model, network_model)
Expand All @@ -773,8 +761,7 @@ function construct_device!(
model::DeviceModel{T, HVDCTwoTerminalDispatch},
network_model::NetworkModel{<:PM.AbstractActivePowerModel},
) where {T <: TwoTerminalHVDCTypes}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)
add_constraints!(container, FlowRateConstraintFromTo, devices, model, network_model)
add_constraints!(container, FlowRateConstraintToFrom, devices, model, network_model)
add_constraints!(container, HVDCPowerBalance, devices, model, network_model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function construct_device!(
R <: PSY.RenewableGen,
D <: AbstractRenewableDispatchFormulation,
}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

add_variables!(container, ActivePowerVariable, devices, D())
add_variables!(container, ReactivePowerVariable, devices, D())
Expand Down Expand Up @@ -62,8 +61,7 @@ function construct_device!(
model::DeviceModel{R, <:AbstractRenewableDispatchFormulation},
network_model::NetworkModel{<:PM.AbstractPowerModel},
) where {R <: PSY.RenewableGen}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

if has_service_model(model)
add_constraints!(
Expand Down Expand Up @@ -119,8 +117,7 @@ function construct_device!(
R <: PSY.RenewableGen,
D <: AbstractRenewableDispatchFormulation,
}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

add_variables!(container, ActivePowerVariable, devices, D())

Expand Down Expand Up @@ -164,8 +161,7 @@ function construct_device!(
model::DeviceModel{R, <:AbstractRenewableDispatchFormulation},
network_model::NetworkModel{<:PM.AbstractActivePowerModel},
) where {R <: PSY.RenewableGen}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

if has_service_model(model)
add_constraints!(
Expand Down Expand Up @@ -210,8 +206,7 @@ function construct_device!(
model::DeviceModel{R, FixedOutput},
network_model::NetworkModel{<:PM.AbstractPowerModel},
) where {R <: PSY.RenewableGen}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
add_parameters!(container, ReactivePowerTimeSeriesParameter, devices, model)
Expand Down Expand Up @@ -242,8 +237,7 @@ function construct_device!(
model::DeviceModel{R, FixedOutput},
network_model::NetworkModel{<:PM.AbstractActivePowerModel},
) where {R <: PSY.RenewableGen}
devices =
get_available_components(model, sys)
devices = get_available_components(model, sys)

add_parameters!(container, ActivePowerTimeSeriesParameter, devices, model)
add_to_expression!(
Expand Down
Loading

0 comments on commit 5662db1

Please sign in to comment.