From 7986bae03be0a510e43a78e6ac55c89b0aa77fdf Mon Sep 17 00:00:00 2001 From: pesap Date: Thu, 12 Sep 2024 13:36:49 -0600 Subject: [PATCH 1/2] feat: Added flexibility to either read "Up", "UP" or "uP" --- src/parsers/power_system_table_data.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parsers/power_system_table_data.jl b/src/parsers/power_system_table_data.jl index 39b2340811..9c90423456 100644 --- a/src/parsers/power_system_table_data.jl +++ b/src/parsers/power_system_table_data.jl @@ -775,9 +775,9 @@ function services_csv_parser!(sys::System, data::PowerSystemTableData) end function get_reserve_direction(direction::AbstractString) - if direction == "Up" + if lowercase(direction) == "up" return ReserveUp - elseif direction == "Down" + elseif lowercase(direction) == "down" return ReserveDown else throw(DataFormatError("invalid reserve direction $direction")) From e70469789fb0cd6016e2f6f34ef333ba99fefadf Mon Sep 17 00:00:00 2001 From: pesap Date: Thu, 12 Sep 2024 14:08:03 -0600 Subject: [PATCH 2/2] fix: Updated test to accept "up" or "down" --- test/test_power_system_table_data.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_power_system_table_data.jl b/test/test_power_system_table_data.jl index 04b3fac1ff..85e088243e 100644 --- a/test/test_power_system_table_data.jl +++ b/test/test_power_system_table_data.jl @@ -154,8 +154,10 @@ end @testset "Test reserve direction" begin @test PSY.get_reserve_direction("Up") == ReserveUp @test PSY.get_reserve_direction("Down") == ReserveDown + @test PSY.get_reserve_direction("up") == ReserveUp + @test PSY.get_reserve_direction("down") == ReserveDown - for invalid in ("up", "down", "right", "left") + for invalid in ("right", "left") @test_throws PSY.DataFormatError PSY.get_reserve_direction(invalid) end end