From b7d62bbe8ee8233cd57c377705f2d2e827582411 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Tue, 22 Feb 2022 15:44:09 -0800 Subject: [PATCH] refactor: connect transformers in 'cascade' rather than 'tree' --- prereise/gather/griddata/hifld/data_process/transmission.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prereise/gather/griddata/hifld/data_process/transmission.py b/prereise/gather/griddata/hifld/data_process/transmission.py index 3e7e71cb1..bfb2025d5 100644 --- a/prereise/gather/griddata/hifld/data_process/transmission.py +++ b/prereise/gather/griddata/hifld/data_process/transmission.py @@ -517,9 +517,9 @@ def create_transformers(bus): ["from_bus_id", "to_bus_id"]. """ bus_pairs = [ - (b, volt_series.idxmax()) + (b, volt_series.sort_values().index[i + 1]) for sub, volt_series in bus.groupby("sub_id")["baseKV"] - for b in volt_series.sort_values().index[:-1] + for i, b in enumerate(volt_series.sort_values().index[:-1]) if len(volt_series) > 1 ]