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 myopic optimization for networks with geothermal district heating #1453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions scripts/add_brownfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def update_heat_pump_efficiency(n: pypsa.Network, n_p: pypsa.Network, year: int)
# get names of heat pumps in previous iteration
heat_pump_idx_previous_iteration = n_p.links.index[
n_p.links.index.str.contains("heat pump")
& n_p.links.index.str[:-4].isin(n.links_t.efficiency.columns.str[:-4])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I would need an additional comment here to follow here :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpschau, here one could be more explicit using the planning_horizon wildcard.

]
# construct names of same-technology heat pumps in the current iteration
corresponding_idx_this_iteration = heat_pump_idx_previous_iteration.str[:-4] + str(
Expand Down
5 changes: 4 additions & 1 deletion scripts/build_existing_heating_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ def build_existing_heating():
] += nodal_heat_name_tech[(f"{sector} rural", "air heat pump")]
nodal_heat_name_tech[(f"{sector} rural", "air heat pump")] = 0.0

nodal_heat_name_tech[("urban central", "ground heat pump")] = 0.0
for heat_pump_source in snakemake.params.sector["heat_pump_sources"][
"urban central"
]:
nodal_heat_name_tech[("urban central", f"{heat_pump_source} heat pump")] = 0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have the time: could you add a comment or two to the function and convert the function header to a docstring?


nodal_heat_name_tech.to_csv(snakemake.output.existing_heating_distribution)

Expand Down
Loading