From 41917096453fe75fea95001da902429cdf1634ed Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sat, 16 Mar 2024 13:34:25 -0600 Subject: [PATCH 1/8] updates for transmission interface --- src/core/optimization_container.jl | 22 +++++++------ src/services_models/services_constructor.jl | 20 ++++++++++++ test/test_services_constructor.jl | 34 +++++++++++++++++++++ 3 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/core/optimization_container.jl b/src/core/optimization_container.jl index 9f5310e0a0..1c58ae8c2e 100644 --- a/src/core/optimization_container.jl +++ b/src/core/optimization_container.jl @@ -567,6 +567,7 @@ function build_impl!( ArgumentConstructStage(), get_service_models(template), get_device_models(template), + transmission_model, ) end @@ -588,16 +589,6 @@ function build_impl!( end end - TimerOutputs.@timeit BUILD_PROBLEMS_TIMER "Services" begin - construct_services!( - container, - sys, - ModelConstructStage(), - get_service_models(template), - get_device_models(template), - ) - end - for device_model in values(template.devices) @debug "Building Model for $(get_component_type(device_model)) with $(get_formulation(device_model)) formulation" _group = LOG_GROUP_OPTIMIZATION_CONTAINER @@ -643,6 +634,17 @@ function build_impl!( end end + TimerOutputs.@timeit BUILD_PROBLEMS_TIMER "Services" begin + construct_services!( + container, + sys, + ModelConstructStage(), + get_service_models(template), + get_device_models(template), + transmission_model, + ) + end + TimerOutputs.@timeit BUILD_PROBLEMS_TIMER "Objective" begin @debug "Building Objective" _group = LOG_GROUP_OPTIMIZATION_CONTAINER update_objective_function!(container) diff --git a/src/services_models/services_constructor.jl b/src/services_models/services_constructor.jl index 6737e3c621..2f9849a89d 100644 --- a/src/services_models/services_constructor.jl +++ b/src/services_models/services_constructor.jl @@ -18,6 +18,7 @@ function construct_services!( stage::ArgumentConstructStage, services_template::ServicesModelContainer, devices_template::DevicesModelContainer, + network_model::NetworkModel{<:PM.AbstractPowerModel}, ) isempty(services_template) && return incompatible_device_types = get_incompatible_devices(devices_template) @@ -37,6 +38,7 @@ function construct_services!( service_model, devices_template, incompatible_device_types, + network_model, ) end groupservice === nothing || construct_service!( @@ -56,6 +58,7 @@ function construct_services!( stage::ModelConstructStage, services_template::ServicesModelContainer, devices_template::DevicesModelContainer, + network_model::NetworkModel{<:PM.AbstractPowerModel}, ) isempty(services_template) && return incompatible_device_types = get_incompatible_devices(devices_template) @@ -74,6 +77,7 @@ function construct_services!( service_model, devices_template, incompatible_device_types, + network_model, ) end groupservice === nothing || construct_service!( @@ -94,6 +98,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -119,6 +124,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -148,6 +154,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -172,6 +179,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -200,6 +208,7 @@ function construct_service!( model::ServiceModel{SR, StepwiseCostReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -224,6 +233,7 @@ function construct_service!( model::ServiceModel{SR, StepwiseCostReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -246,6 +256,7 @@ function construct_service!( model::ServiceModel{S, T}, devices_template::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {S <: PSY.AGC, T <: AbstractAGCFormulation} services = get_available_components(S, sys) agc_areas = PSY.get_area.(services) @@ -299,6 +310,7 @@ function construct_service!( model::ServiceModel{S, T}, devices_template::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {S <: PSY.AGC, T <: AbstractAGCFormulation} areas = PSY.get_components(PSY.Area, sys) services = get_available_components(S, sys) @@ -340,6 +352,7 @@ function construct_service!( model::ServiceModel{SR, GroupReserve}, ::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserveGroup} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -357,6 +370,7 @@ function construct_service!( model::ServiceModel{SR, GroupReserve}, ::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserveGroup} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -381,6 +395,7 @@ function construct_service!( model::ServiceModel{SR, RampReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -406,6 +421,7 @@ function construct_service!( model::ServiceModel{SR, RampReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -436,6 +452,7 @@ function construct_service!( model::ServiceModel{SR, NonSpinningReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.ReserveNonSpinning} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -460,6 +477,7 @@ function construct_service!( model::ServiceModel{SR, NonSpinningReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.ReserveNonSpinning} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -497,6 +515,7 @@ function construct_service!( model::ServiceModel{T, ConstantMaxInterfaceFlow}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + network_model::NetworkModel{<:PM.AbstractPowerModel}, ) where {T <: PSY.TransmissionInterface} interfaces = get_available_components(T, sys) if get_use_slacks(model) @@ -524,6 +543,7 @@ function construct_service!( model::ServiceModel{T, ConstantMaxInterfaceFlow}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + network_model::NetworkModel{<:PM.AbstractActivePowerModel}, ) where {T <: PSY.TransmissionInterface} name = get_service_name(model) service = PSY.get_component(T, sys, name) diff --git a/test/test_services_constructor.jl b/test/test_services_constructor.jl index 28bc99ac2e..02921a323e 100644 --- a/test/test_services_constructor.jl +++ b/test/test_services_constructor.jl @@ -389,3 +389,37 @@ end @test found_constraints == 2 end + +@testset "Test Transmission Interface" begin + c_sys5_uc = PSB.build_system(PSITestSystems, "c_sys5_uc"; add_reserves = true) + interface = TransmissionInterface(; + name = "west_east", + available = true, + active_power_flow_limits = (min = 0.0, max = 400.0), + ) + interface_lines = [ + get_component(Line, c_sys5_uc, "1"), + get_component(Line, c_sys5_uc, "2"), + get_component(Line, c_sys5_uc, "6"), + ] + add_service!(c_sys5_uc, interface, interface_lines) + + template = get_thermal_dispatch_template_network(DCPPowerModel) + set_service_model!( + template, + ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true), + ) + + model = DecisionModel(template, c_sys5_uc) + @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT + moi_tests(model, 432, 144, 288, 288, 288, false) + + template = get_thermal_dispatch_template_network(PTDFPowerModel) + set_service_model!( + template, + ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true), + ) + model = DecisionModel(template, c_sys5_uc) + @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT + moi_tests(model, 312, 0, 288, 288, 168, false) +end From 134112d569fb30b4ecdb77f8d8a956f617fdea93 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sat, 16 Mar 2024 13:35:56 -0600 Subject: [PATCH 2/8] WIP: Add AC test --- test/test_services_constructor.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_services_constructor.jl b/test/test_services_constructor.jl index 02921a323e..8dc4599063 100644 --- a/test/test_services_constructor.jl +++ b/test/test_services_constructor.jl @@ -422,4 +422,15 @@ end model = DecisionModel(template, c_sys5_uc) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT moi_tests(model, 312, 0, 288, 288, 168, false) + + #= TODO: Fix this test + template = get_thermal_dispatch_template_network(ACPPowerModel; use_slacks = true) where + set_service_model!( + template, + ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true), + ) + model = DecisionModel(template, c_sys5_uc) + @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT + moi_tests(model, 312, 0, 288, 288, 168, false) + =# end From af706f89e8f8dbbe6e9bd5bdd0fd46508d0a2774 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 17 Mar 2024 14:05:03 -0600 Subject: [PATCH 3/8] add missing argument to constructors --- src/services_models/services_constructor.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services_models/services_constructor.jl b/src/services_models/services_constructor.jl index 2f9849a89d..7f909b9e22 100644 --- a/src/services_models/services_constructor.jl +++ b/src/services_models/services_constructor.jl @@ -48,6 +48,7 @@ function construct_services!( services_template[groupservice], devices_template, incompatible_device_types, + network_model ) return end @@ -87,6 +88,7 @@ function construct_services!( services_template[groupservice], devices_template, incompatible_device_types, + network_model, ) return end From ed83f7a41cd27d9edfa7588b45bb27147eef1ad0 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 17 Mar 2024 14:17:50 -0600 Subject: [PATCH 4/8] Update src/services_models/services_constructor.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/services_models/services_constructor.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services_models/services_constructor.jl b/src/services_models/services_constructor.jl index 7f909b9e22..8602cb9dd5 100644 --- a/src/services_models/services_constructor.jl +++ b/src/services_models/services_constructor.jl @@ -48,7 +48,7 @@ function construct_services!( services_template[groupservice], devices_template, incompatible_device_types, - network_model + network_model, ) return end From 3dcfd3dad3a33c2ce3bf451de21140de2f2c306d Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sat, 16 Mar 2024 13:34:25 -0600 Subject: [PATCH 5/8] updates for transmission interface --- src/core/optimization_container.jl | 22 +++++++------ src/services_models/services_constructor.jl | 20 ++++++++++++ test/test_services_constructor.jl | 34 +++++++++++++++++++++ 3 files changed, 66 insertions(+), 10 deletions(-) diff --git a/src/core/optimization_container.jl b/src/core/optimization_container.jl index 9f5310e0a0..1c58ae8c2e 100644 --- a/src/core/optimization_container.jl +++ b/src/core/optimization_container.jl @@ -567,6 +567,7 @@ function build_impl!( ArgumentConstructStage(), get_service_models(template), get_device_models(template), + transmission_model, ) end @@ -588,16 +589,6 @@ function build_impl!( end end - TimerOutputs.@timeit BUILD_PROBLEMS_TIMER "Services" begin - construct_services!( - container, - sys, - ModelConstructStage(), - get_service_models(template), - get_device_models(template), - ) - end - for device_model in values(template.devices) @debug "Building Model for $(get_component_type(device_model)) with $(get_formulation(device_model)) formulation" _group = LOG_GROUP_OPTIMIZATION_CONTAINER @@ -643,6 +634,17 @@ function build_impl!( end end + TimerOutputs.@timeit BUILD_PROBLEMS_TIMER "Services" begin + construct_services!( + container, + sys, + ModelConstructStage(), + get_service_models(template), + get_device_models(template), + transmission_model, + ) + end + TimerOutputs.@timeit BUILD_PROBLEMS_TIMER "Objective" begin @debug "Building Objective" _group = LOG_GROUP_OPTIMIZATION_CONTAINER update_objective_function!(container) diff --git a/src/services_models/services_constructor.jl b/src/services_models/services_constructor.jl index 6737e3c621..2f9849a89d 100644 --- a/src/services_models/services_constructor.jl +++ b/src/services_models/services_constructor.jl @@ -18,6 +18,7 @@ function construct_services!( stage::ArgumentConstructStage, services_template::ServicesModelContainer, devices_template::DevicesModelContainer, + network_model::NetworkModel{<:PM.AbstractPowerModel}, ) isempty(services_template) && return incompatible_device_types = get_incompatible_devices(devices_template) @@ -37,6 +38,7 @@ function construct_services!( service_model, devices_template, incompatible_device_types, + network_model, ) end groupservice === nothing || construct_service!( @@ -56,6 +58,7 @@ function construct_services!( stage::ModelConstructStage, services_template::ServicesModelContainer, devices_template::DevicesModelContainer, + network_model::NetworkModel{<:PM.AbstractPowerModel}, ) isempty(services_template) && return incompatible_device_types = get_incompatible_devices(devices_template) @@ -74,6 +77,7 @@ function construct_services!( service_model, devices_template, incompatible_device_types, + network_model, ) end groupservice === nothing || construct_service!( @@ -94,6 +98,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -119,6 +124,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -148,6 +154,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -172,6 +179,7 @@ function construct_service!( model::ServiceModel{SR, RangeReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -200,6 +208,7 @@ function construct_service!( model::ServiceModel{SR, StepwiseCostReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -224,6 +233,7 @@ function construct_service!( model::ServiceModel{SR, StepwiseCostReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -246,6 +256,7 @@ function construct_service!( model::ServiceModel{S, T}, devices_template::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {S <: PSY.AGC, T <: AbstractAGCFormulation} services = get_available_components(S, sys) agc_areas = PSY.get_area.(services) @@ -299,6 +310,7 @@ function construct_service!( model::ServiceModel{S, T}, devices_template::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {S <: PSY.AGC, T <: AbstractAGCFormulation} areas = PSY.get_components(PSY.Area, sys) services = get_available_components(S, sys) @@ -340,6 +352,7 @@ function construct_service!( model::ServiceModel{SR, GroupReserve}, ::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserveGroup} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -357,6 +370,7 @@ function construct_service!( model::ServiceModel{SR, GroupReserve}, ::Dict{Symbol, DeviceModel}, ::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.StaticReserveGroup} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -381,6 +395,7 @@ function construct_service!( model::ServiceModel{SR, RampReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -406,6 +421,7 @@ function construct_service!( model::ServiceModel{SR, RampReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.Reserve} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -436,6 +452,7 @@ function construct_service!( model::ServiceModel{SR, NonSpinningReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.ReserveNonSpinning} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -460,6 +477,7 @@ function construct_service!( model::ServiceModel{SR, NonSpinningReserve}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + ::NetworkModel{<:PM.AbstractPowerModel}, ) where {SR <: PSY.ReserveNonSpinning} name = get_service_name(model) service = PSY.get_component(SR, sys, name) @@ -497,6 +515,7 @@ function construct_service!( model::ServiceModel{T, ConstantMaxInterfaceFlow}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + network_model::NetworkModel{<:PM.AbstractPowerModel}, ) where {T <: PSY.TransmissionInterface} interfaces = get_available_components(T, sys) if get_use_slacks(model) @@ -524,6 +543,7 @@ function construct_service!( model::ServiceModel{T, ConstantMaxInterfaceFlow}, devices_template::Dict{Symbol, DeviceModel}, incompatible_device_types::Set{<:DataType}, + network_model::NetworkModel{<:PM.AbstractActivePowerModel}, ) where {T <: PSY.TransmissionInterface} name = get_service_name(model) service = PSY.get_component(T, sys, name) diff --git a/test/test_services_constructor.jl b/test/test_services_constructor.jl index 28bc99ac2e..02921a323e 100644 --- a/test/test_services_constructor.jl +++ b/test/test_services_constructor.jl @@ -389,3 +389,37 @@ end @test found_constraints == 2 end + +@testset "Test Transmission Interface" begin + c_sys5_uc = PSB.build_system(PSITestSystems, "c_sys5_uc"; add_reserves = true) + interface = TransmissionInterface(; + name = "west_east", + available = true, + active_power_flow_limits = (min = 0.0, max = 400.0), + ) + interface_lines = [ + get_component(Line, c_sys5_uc, "1"), + get_component(Line, c_sys5_uc, "2"), + get_component(Line, c_sys5_uc, "6"), + ] + add_service!(c_sys5_uc, interface, interface_lines) + + template = get_thermal_dispatch_template_network(DCPPowerModel) + set_service_model!( + template, + ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true), + ) + + model = DecisionModel(template, c_sys5_uc) + @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT + moi_tests(model, 432, 144, 288, 288, 288, false) + + template = get_thermal_dispatch_template_network(PTDFPowerModel) + set_service_model!( + template, + ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true), + ) + model = DecisionModel(template, c_sys5_uc) + @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT + moi_tests(model, 312, 0, 288, 288, 168, false) +end From 18e32c5d40bad58ae02c155384d376fc05eb5e70 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sat, 16 Mar 2024 13:35:56 -0600 Subject: [PATCH 6/8] WIP: Add AC test --- test/test_services_constructor.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_services_constructor.jl b/test/test_services_constructor.jl index 02921a323e..8dc4599063 100644 --- a/test/test_services_constructor.jl +++ b/test/test_services_constructor.jl @@ -422,4 +422,15 @@ end model = DecisionModel(template, c_sys5_uc) @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT moi_tests(model, 312, 0, 288, 288, 168, false) + + #= TODO: Fix this test + template = get_thermal_dispatch_template_network(ACPPowerModel; use_slacks = true) where + set_service_model!( + template, + ServiceModel(TransmissionInterface, ConstantMaxInterfaceFlow; use_slacks = true), + ) + model = DecisionModel(template, c_sys5_uc) + @test build!(model; output_dir = mktempdir(; cleanup = true)) == PSI.BuildStatus.BUILT + moi_tests(model, 312, 0, 288, 288, 168, false) + =# end From 582636524c157023bdbb921dfc6fd0c12df627f2 Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 17 Mar 2024 14:05:03 -0600 Subject: [PATCH 7/8] add missing argument to constructors --- src/services_models/services_constructor.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services_models/services_constructor.jl b/src/services_models/services_constructor.jl index 2f9849a89d..7f909b9e22 100644 --- a/src/services_models/services_constructor.jl +++ b/src/services_models/services_constructor.jl @@ -48,6 +48,7 @@ function construct_services!( services_template[groupservice], devices_template, incompatible_device_types, + network_model ) return end @@ -87,6 +88,7 @@ function construct_services!( services_template[groupservice], devices_template, incompatible_device_types, + network_model, ) return end From 1da67c9740f64176421225ca44b0109f1094e58d Mon Sep 17 00:00:00 2001 From: Jose Daniel Lara Date: Sun, 17 Mar 2024 14:17:50 -0600 Subject: [PATCH 8/8] Update src/services_models/services_constructor.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/services_models/services_constructor.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services_models/services_constructor.jl b/src/services_models/services_constructor.jl index 7f909b9e22..8602cb9dd5 100644 --- a/src/services_models/services_constructor.jl +++ b/src/services_models/services_constructor.jl @@ -48,7 +48,7 @@ function construct_services!( services_template[groupservice], devices_template, incompatible_device_types, - network_model + network_model, ) return end