From 8f3a9ea4e252e18c961e2e62e864b0dd1b717d2f Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Mon, 4 Apr 2022 13:00:00 -0700 Subject: [PATCH] test: add test for split_lines_to_ac_and_dc function --- .../hifld/data_process/tests/test_transmission.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/prereise/gather/griddata/hifld/data_process/tests/test_transmission.py b/prereise/gather/griddata/hifld/data_process/tests/test_transmission.py index ca9459e9a..31d278354 100644 --- a/prereise/gather/griddata/hifld/data_process/tests/test_transmission.py +++ b/prereise/gather/griddata/hifld/data_process/tests/test_transmission.py @@ -17,6 +17,7 @@ estimate_branch_rating, filter_islands_and_connect_with_mst, map_lines_to_substations_using_coords, + split_lines_to_ac_and_dc, ) @@ -341,3 +342,14 @@ def test_assign_buses_to_lines(): assert ac_lines["to_bus_id"].equals(pd.Series([310, 311, 410])) assert dc_lines["from_bus_id"].equals(pd.Series([311])) assert dc_lines["to_bus_id"].equals(pd.Series([400])) + + +def test_split_lines_to_ac_and_dc(): + lines = pd.DataFrame( + {"TYPE": ["DC; OVERHEAD", "DC; UNDERGROUND", "AC", "AC", "unknown", "unknown"]}, + index=[101, 102, 103, 104, 105, 106], + ) + dc_override_indices = {105} + ac_lines, dc_lines = split_lines_to_ac_and_dc(lines, dc_override_indices) + assert ac_lines.index.tolist() == [103, 104, 106] + assert dc_lines.index.tolist() == [101, 102, 105]