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 30, 2024
1 parent b27227f commit a9853b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 9 additions & 4 deletions scripts/add_brownfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,17 @@ 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")]
heat_pump_idx_previous_iteration = n_p.links.index[
n_p.links.index.str.contains("heat pump")
]
# construct names of same-technology heat pumps in the current iteration
corresponding_idx_this_iteration = heat_pump_idx_previous_iteration.str[:-4] + str(year)
corresponding_idx_this_iteration = heat_pump_idx_previous_iteration.str[:-4] + str(
year
)
# update efficiency of heat pumps in previous iteration in-place to efficiency in this iteration
n_p.links_t["efficiency"].loc[:, heat_pump_idx_previous_iteration] = n.links_t["efficiency"].loc[:, corresponding_idx_this_iteration].values

n_p.links_t["efficiency"].loc[:, heat_pump_idx_previous_iteration] = (
n.links_t["efficiency"].loc[:, corresponding_idx_this_iteration].values
)


if __name__ == "__main__":
Expand Down
3 changes: 0 additions & 3 deletions scripts/prepare_perfect_foresight.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,6 @@ def update_heat_pump_efficiency(n: pypsa.Network, years: List[int]):
] = correct_efficiency.values





if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake
Expand Down

0 comments on commit a9853b0

Please sign in to comment.