From 7cec90b9a8d251eadcee48eb0100621c4b8f85af Mon Sep 17 00:00:00 2001 From: Greg Miller <45949268+grgmiller@users.noreply.github.com> Date: Sat, 10 Dec 2022 13:50:06 -0800 Subject: [PATCH] fix missing generator_id --- src/pudl/analysis/epacamd_eia.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pudl/analysis/epacamd_eia.py b/src/pudl/analysis/epacamd_eia.py index 2b3565e06f..b47f5f76ad 100644 --- a/src/pudl/analysis/epacamd_eia.py +++ b/src/pudl/analysis/epacamd_eia.py @@ -120,7 +120,7 @@ def _prep_for_networkx(crosswalk: pd.DataFrame) -> pd.DataFrame: by=["plant_id_eia", "emissions_unit_id_epa"] ).ngroup() # node IDs can't overlap so add (max + 1) - prepped["generator_id"] = ( + prepped["generator_id_unique"] = ( prepped.groupby(by=["plant_id_eia", "generator_id"]).ngroup() + prepped["combustor_id"].max() + 1 @@ -141,7 +141,7 @@ def _subplant_ids_from_prepped_crosswalk(prepped: pd.DataFrame) -> pd.DataFrame: graph = nx.from_pandas_edgelist( prepped, source="combustor_id", - target="generator_id", + target="generator_id_unique", edge_attr=True, ) for i, node_set in enumerate(nx.connected_components(graph)):