Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix runoff in case runoff data are missed for some hydropower plants #757

Merged
merged 6 commits into from
Jul 3, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/add_electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,14 +475,16 @@ def attach_hydro(n, costs, ppl):

logger.warning(
f"'{snakemake.input.profile_hydro}' is missing inflow time-series for at least one bus: {', '.join(missing_plants)}."
f"Corresponding hydro plants are dropped, corresponding to a total loss of {loss_p_nom}MW out of {total_p_nom}MW."
f"Corresponding hydro plants are dropped, corresponding to a total loss of {loss_p_nom:.2f}MW out of {total_p_nom:.2f}MW."
)
else:
idxs_to_keep = inflow_idx

if not intersection_plants.empty:
inflow_t = (
inflow.sel(plant=intersection_plants)
.rename({"plant": "name"})
.assign_coords(name=inflow_idx)
.assign_coords(name=idxs_to_keep)
.transpose("time", "name")
.to_pandas()
)
Expand Down
Loading