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( 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()