Skip to content

Commit

Permalink
Merge pull request #2122 from catalyst-cooperative/epacamd_eia_missin…
Browse files Browse the repository at this point in the history
…g_generator_id

fix missing generator_id
  • Loading branch information
zaneselvans authored Dec 14, 2022
2 parents a1a3958 + 7cec90b commit b03f5f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pudl/analysis/epacamd_eia.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)):
Expand Down

0 comments on commit b03f5f2

Please sign in to comment.