Skip to content

Commit 8f3a9ea

Browse files
committed
test: add test for split_lines_to_ac_and_dc function
1 parent 9644dea commit 8f3a9ea

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

prereise/gather/griddata/hifld/data_process/tests/test_transmission.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
estimate_branch_rating,
1818
filter_islands_and_connect_with_mst,
1919
map_lines_to_substations_using_coords,
20+
split_lines_to_ac_and_dc,
2021
)
2122

2223

@@ -341,3 +342,14 @@ def test_assign_buses_to_lines():
341342
assert ac_lines["to_bus_id"].equals(pd.Series([310, 311, 410]))
342343
assert dc_lines["from_bus_id"].equals(pd.Series([311]))
343344
assert dc_lines["to_bus_id"].equals(pd.Series([400]))
345+
346+
347+
def test_split_lines_to_ac_and_dc():
348+
lines = pd.DataFrame(
349+
{"TYPE": ["DC; OVERHEAD", "DC; UNDERGROUND", "AC", "AC", "unknown", "unknown"]},
350+
index=[101, 102, 103, 104, 105, 106],
351+
)
352+
dc_override_indices = {105}
353+
ac_lines, dc_lines = split_lines_to_ac_and_dc(lines, dc_override_indices)
354+
assert ac_lines.index.tolist() == [103, 104, 106]
355+
assert dc_lines.index.tolist() == [101, 102, 105]

0 commit comments

Comments
 (0)