From 67f4e7e21ae900e54803878ffe62add9c9910fce Mon Sep 17 00:00:00 2001 From: GabrielKS <23368820+GabrielKS@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:47:03 -0600 Subject: [PATCH] Add imports to fix bug 1125, test that --- src/PowerSimulations.jl | 2 ++ test/test_model_decision.jl | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/PowerSimulations.jl b/src/PowerSimulations.jl index 36af71cee2..e3a3eb9fb9 100644 --- a/src/PowerSimulations.jl +++ b/src/PowerSimulations.jl @@ -365,6 +365,7 @@ import InfrastructureSystems.Optimization: list_variable_names, list_dual_names, list_parameter_names, list_aux_variable_names, list_expression_names import InfrastructureSystems.Optimization: read_optimizer_stats, get_optimizer_stats, export_results, serialize_results, get_timestamps, get_model_base_power +import InfrastructureSystems.Optimization: get_resolution, get_forecast_horizon # IS.Optimization imports that stay private, may or may not be additional methods in PowerSimulations import InfrastructureSystems.Optimization: ArgumentConstructStage, ModelConstructStage @@ -392,6 +393,7 @@ export get_model_base_power export get_optimizer_stats export get_timestamps export get_resolution + import PowerModels import TimerOutputs import ProgressMeter diff --git a/test/test_model_decision.jl b/test/test_model_decision.jl index 1958c0bda3..fbcdc0392c 100644 --- a/test/test_model_decision.jl +++ b/test/test_model_decision.jl @@ -231,9 +231,11 @@ end @test isa(read_duals(res), Dict{String, DataFrames.DataFrame}) @test isa(res.parameter_values, Dict{PSI.ParameterKey, DataFrames.DataFrame}) @test isa(read_parameters(res), Dict{String, DataFrames.DataFrame}) - @test isa(IS.Optimization.get_resolution(res), Dates.TimePeriod) + @test isa(PSI.get_resolution(res), Dates.TimePeriod) + @test isa(PSI.get_forecast_horizon(res), Int64) + @test isa(get_realized_timestamps(res), StepRange{DateTime}) @test isa(IS.Optimization.get_source_data(res), PSY.System) - @test length(IS.Optimization.get_timestamps(res)) == 24 + @test length(get_timestamps(res)) == 24 end @testset "Solve DecisionModelModel with auto-build" begin