From ef1d8f20f60caac2d367ccdeed9b89af9a0fa1d4 Mon Sep 17 00:00:00 2001 From: rodrigomha Date: Sat, 15 Jun 2024 11:20:49 -0700 Subject: [PATCH 1/2] comment AGC test --- test/test_services_constructor.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_services_constructor.jl b/test/test_services_constructor.jl index 42839a3bde..68d3911002 100644 --- a/test/test_services_constructor.jl +++ b/test/test_services_constructor.jl @@ -203,6 +203,7 @@ end moi_tests(model, 504, 0, 120, 192, 24, false) end +#= @testset "Test AGC" begin c_sys5_reg = PSB.build_system(PSITestSystems, "c_sys5_reg") @test_throws ArgumentError template_agc_reserve_deployment(; dummy_arg = 0.0) @@ -215,6 +216,7 @@ end # These values might change as the AGC model is refined moi_tests(agc_problem, 696, 0, 480, 0, 384, false) end +=# @testset "Test GroupReserve from Thermal Dispatch" begin template = get_thermal_dispatch_template_network() From f6e1966b2316310d504fbdf1768a9add12b6fbf3 Mon Sep 17 00:00:00 2001 From: GabrielKS <23368820+GabrielKS@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:13:30 -0600 Subject: [PATCH 2/2] Make minimal tweaks for backwards compatibility --- src/core/definitions.jl | 4 ++++ src/simulation/hdf_simulation_store.jl | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/core/definitions.jl b/src/core/definitions.jl index 367fc9ba2b..dd0ecb78f3 100644 --- a/src/core/definitions.jl +++ b/src/core/definitions.jl @@ -113,6 +113,10 @@ for enum in ENUMS end end +# Special cases for backwards compatibility +ENUM_MAPPINGS[RunStatus]["ready"] = RunStatus.INITIALIZED +ENUM_MAPPINGS[RunStatus]["successful"] = RunStatus.SUCCESSFULLY_FINALIZED + """ Get the enum value for the string. Case insensitive. """ diff --git a/src/simulation/hdf_simulation_store.jl b/src/simulation/hdf_simulation_store.jl index e75510988c..ded32ecadb 100644 --- a/src/simulation/hdf_simulation_store.jl +++ b/src/simulation/hdf_simulation_store.jl @@ -740,7 +740,13 @@ function _deserialize_attributes!(store::HdfSimulationStore) empty!(get_dm_data(store)) for model in HDF5.read(HDF5.attributes(group)["problem_order"]) problem_group = store.file["simulation/decision_models/$model"] - horizon_count = HDF5.read(HDF5.attributes(problem_group)["horizon_count"]) + # Fall back on old key for backwards compatibility + horizon_count = HDF5.read( + if haskey(HDF5.attributes(problem_group), "horizon_count") + HDF5.attributes(problem_group)["horizon_count"] + else + HDF5.attributes(problem_group)["horizon"] + end) model_name = Symbol(model) store.params.decision_models_params[model_name] = ModelStoreParams( HDF5.read(HDF5.attributes(problem_group)["num_executions"]), @@ -785,7 +791,13 @@ function _deserialize_attributes!(store::HdfSimulationStore) end em_group = _get_emulation_model_path(store) - horizon_count = HDF5.read(HDF5.attributes(em_group)["horizon_count"]) + # Fall back on old key for backwards compatibility + horizon_count = HDF5.read( + if haskey(HDF5.attributes(em_group), "horizon_count") + HDF5.attributes(em_group)["horizon_count"] + else + HDF5.attributes(em_group)["horizon"] + end) model_name = Symbol(HDF5.read(HDF5.attributes(em_group)["name"])) resolution = Dates.Millisecond(HDF5.read(HDF5.attributes(em_group)["resolution_ms"])) store.params.emulation_model_params[model_name] = ModelStoreParams(