Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/annual-temperature-reduction' in…
Browse files Browse the repository at this point in the history
…to annual-temperature-reduction
  • Loading branch information
amos-schledorn committed Sep 17, 2024
2 parents 30f7dce + 4107e31 commit bf87e8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion scripts/add_brownfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ def adjust_renewable_profiles(n, input_profiles, params, year):

def update_heat_pump_efficiency(n: pypsa.Network, n_p: pypsa.Network, year: int):
"""
Update the efficiency of heat pumps from previous years to current year (e.g. 2030 heat pumps receive 2040 heat pump COPs in 2030).
Update the efficiency of heat pumps from previous years to current year
(e.g. 2030 heat pumps receive 2040 heat pump COPs in 2030).
Parameters
----------
Expand Down
12 changes: 9 additions & 3 deletions scripts/prepare_perfect_foresight.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,11 @@ def apply_time_segmentation_perfect(

return n


def update_heat_pump_efficiency(n: pypsa.Network, years: List[int]):
"""
Update the efficiency of heat pumps from previous years to current year (e.g. 2030 heat pumps receive 2040 heat pump COPs in 2030).
Update the efficiency of heat pumps from previous years to current year
(e.g. 2030 heat pumps receive 2040 heat pump COPs in 2030).
Note: this also updates the efficiency of heat pumps in preceding years for previous years, which should have no effect (e.g. 2040 heat pumps receive 2030 COPs in 2030).
Expand All @@ -510,8 +512,12 @@ def update_heat_pump_efficiency(n: pypsa.Network, years: List[int]):
if "heat pump" in link_name:
heat_pump_name = link_name[:-4]
for year in years:
correct_efficiency = n.links_t["efficiency"].loc[(year, slice(None)), heat_pump_name+str(year)]
n.links_t["efficiency"].loc[(year, slice(None)), link_name] = correct_efficiency
correct_efficiency = n.links_t["efficiency"].loc[
(year, slice(None)), heat_pump_name + str(year)
]
n.links_t["efficiency"].loc[
(year, slice(None)), link_name
] = correct_efficiency


if __name__ == "__main__":
Expand Down

0 comments on commit bf87e8c

Please sign in to comment.