Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 25, 2024
1 parent 039eea6 commit 73543f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,15 +528,17 @@ def attach_hydro(n, costs, ppl):
plants_to_keep = plants_with_data.to_numpy()

# hydro_inflow_factor is used to divide the inflow between the various units of each power plant
hydro_inflow_factor = hydro["p_nom"] / hydro.groupby("bus")["p_nom"].transform("sum")
hydro_inflow_factor = hydro["p_nom"] / hydro.groupby("bus")[
"p_nom"
].transform("sum")

inflow_t = (
inflow.sel(plant=plants_to_keep)
.rename({"plant": "name"})
.assign_coords(name=network_buses_to_keep)
.transpose("time", "name")
.to_pandas()
*hydro_inflow_factor
* hydro_inflow_factor
)

if "ror" in carriers and not ror.empty:
Expand Down

0 comments on commit 73543f0

Please sign in to comment.