Skip to content

Commit ec35bd2

Browse files
committed
refactor: update transformer creation test
1 parent 3411d85 commit ec35bd2

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,35 @@ def test_create_transformers():
190190
)
191191
lines = pd.DataFrame(
192192
[
193+
# One branch to low-voltage side of buses (0, 1) transformer
194+
{"from_bus_id": 100, "to_bus_id": 0, "rateA": 75},
193195
# Two branches to high-voltage side of buses (0, 1) transformer
194-
{"from_bus_id": 1, "to_bus_id": 100, "rateA": 100},
195-
{"from_bus_id": 1, "to_bus_id": 101, "rateA": 300},
196-
# Two branches to low-voltage side of buses (2, 3) transformer
197-
{"from_bus_id": 102, "to_bus_id": 2, "rateA": 50},
198-
{"from_bus_id": 103, "to_bus_id": 2, "rateA": 100},
196+
{"from_bus_id": 1, "to_bus_id": 101, "rateA": 100},
197+
{"from_bus_id": 1, "to_bus_id": 102, "rateA": 300},
198+
# Three branches to low-voltage side of buses (2, 3) transformer
199+
{"from_bus_id": 103, "to_bus_id": 2, "rateA": 50},
200+
{"from_bus_id": 104, "to_bus_id": 2, "rateA": 100},
201+
# One branch to high-voltage side of buses (2, 3) transformer
202+
{"from_bus_id": 3, "to_bus_id": 105, "rateA": 300},
199203
# One branch to each side of buses (5, 6) transformer
200204
# The second of these is also on the high-voltage side of buses (4, 5) xfmr
201-
{"from_bus_id": 6, "to_bus_id": 104, "rateA": 500},
202-
{"from_bus_id": 5, "to_bus_id": 105, "rateA": 250},
205+
{"from_bus_id": 6, "to_bus_id": 106, "rateA": 500},
206+
{"from_bus_id": 5, "to_bus_id": 107, "rateA": 250},
203207
# One branch connected to no transformers
204208
{"from_bus_id": 998, "to_bus_id": 999, "rateA": 100e3},
205209
]
206210
)
211+
# One transformer to (0, 1) (only needs to support the low-voltage power)
212+
# Three transformer to (2, 3) (low-voltage side requires 3x transformers in total)
213+
# One transformer to (4, 5) (only needs to support the low-voltage power)
214+
# One transformer to (5, 6) (only needs to support the low-voltage power)
207215
expected_transformers = pd.DataFrame(
208216
{
209-
"from_bus_id": [0, 0, 2, 2, 4, 5],
210-
"to_bus_id": [1, 1, 3, 3, 5, 6],
211-
"x": [0.07, 0.07, 0.19, 0.19, 0.044, 0.018],
212-
"r": [0.001, 0.001, 0.01, 0.01, 0.001, 5e-4],
213-
"rateA": [250.0, 250.0, 60.0, 60.0, 280.0, 580.0],
217+
"from_bus_id": [0, 2, 2, 2, 4, 5],
218+
"to_bus_id": [1, 3, 3, 3, 5, 6],
219+
"x": [0.07, 0.19, 0.19, 0.19, 0.044, 0.018],
220+
"r": [0.001, 0.01, 0.01, 0.01, 0.001, 5e-4],
221+
"rateA": [250.0, 60.0, 60.0, 60.0, 280.0, 580.0],
214222
}
215223
)
216224
transformers = create_transformers(bus, lines, transformer_designs)

0 commit comments

Comments
 (0)