Skip to content

Commit

Permalink
bug: add_electricity only add carriers in powerplant dataset for coun…
Browse files Browse the repository at this point in the history
…try subset
  • Loading branch information
fneum committed May 25, 2024
1 parent a60e6fc commit 7ad930e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,6 @@ def attach_conventional_generators(
fuel_price=None,
):
carriers = list(set(conventional_carriers) | set(extendable_carriers["Generator"]))
add_missing_carriers(n, carriers)
add_co2_emissions(n, costs, carriers)

# Replace carrier "natural gas" with the respective technology (OCGT or
# CCGT) to align with PyPSA names of "carriers" and avoid filtering "natural
Expand All @@ -465,6 +463,11 @@ def attach_conventional_generators(
)
ppl["efficiency"] = ppl.efficiency.fillna(ppl.efficiency_r)

# reduce carriers to those in power plant dataset
carriers = list(set(carriers) & set(ppl.carrier.unique()))
add_missing_carriers(n, carriers)
add_co2_emissions(n, costs, carriers)

if unit_commitment is not None:
committable_attrs = ppl.carrier.isin(unit_commitment).to_frame("committable")
for attr in unit_commitment.index:
Expand Down

0 comments on commit 7ad930e

Please sign in to comment.