[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-08-02 15:28:09 +00:00
parent 10e0b30a40
commit 0259e066e4
2 changed files with 24 additions and 9 deletions

View File

@ -23,9 +23,10 @@ from _helpers import (
) )
from add_electricity import sanitize_carriers from add_electricity import sanitize_carriers
from prepare_sector_network import cluster_heat_buses, define_spatial, prepare_costs from prepare_sector_network import cluster_heat_buses, define_spatial, prepare_costs
from scripts.enums.HeatSector import HeatSector
from scripts.enums.HeatSystem import HeatSystem from scripts.enums.HeatSystem import HeatSystem
from scripts.enums.HeatSystemType import HeatSystemType from scripts.enums.HeatSystemType import HeatSystemType
from scripts.enums.HeatSector import HeatSector
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
cc = coco.CountryConverter() cc = coco.CountryConverter()
@ -462,7 +463,11 @@ def add_heating_capacities_installed_before_baseyear(
costs_name = f"{heat_system.system_type} {heat_source}-sourced heat pump" costs_name = f"{heat_system.system_type} {heat_source}-sourced heat pump"
efficiency = ( efficiency = (
cop.sel(heat_system=heat_system.system_type.value, heat_source=heat_source, name=nodes) cop.sel(
heat_system=heat_system.system_type.value,
heat_source=heat_source,
name=nodes,
)
.to_pandas() .to_pandas()
.reindex(index=n.snapshots) .reindex(index=n.snapshots)
if options["time_dep_hp_cop"] if options["time_dep_hp_cop"]
@ -521,18 +526,26 @@ def add_heating_capacities_installed_before_baseyear(
bus0=nodes_elec, bus0=nodes_elec,
bus1=nodes + " " + heat_system.value + " heat", bus1=nodes + " " + heat_system.value + " heat",
carrier=heat_system + " resistive heater", carrier=heat_system + " resistive heater",
efficiency=costs.at[f"{heat_system.system_type} resistive heater", "efficiency"], efficiency=costs.at[
f"{heat_system.system_type} resistive heater", "efficiency"
],
capital_cost=( capital_cost=(
costs.at[f"{heat_system.system_type} resistive heater", "efficiency"] costs.at[
f"{heat_system.system_type} resistive heater", "efficiency"
]
* costs.at[f"{heat_system.system_type} resistive heater", "fixed"] * costs.at[f"{heat_system.system_type} resistive heater", "fixed"]
), ),
p_nom=( p_nom=(
existing_heating.loc[nodes, (heat_system.value, "resistive heater")] existing_heating.loc[nodes, (heat_system.value, "resistive heater")]
* ratio * ratio
/ costs.at[f"{heat_system.system_type} resistive heater", "efficiency"] / costs.at[
f"{heat_system.system_type} resistive heater", "efficiency"
]
), ),
build_year=int(grouping_year), build_year=int(grouping_year),
lifetime=costs.at[f"{heat_system.system_type} resistive heater", "lifetime"], lifetime=costs.at[
f"{heat_system.system_type} resistive heater", "lifetime"
],
) )
n.madd( n.madd(
@ -543,7 +556,9 @@ def add_heating_capacities_installed_before_baseyear(
bus1=nodes + " " + heat_system + " heat", bus1=nodes + " " + heat_system + " heat",
bus2="co2 atmosphere", bus2="co2 atmosphere",
carrier=heat_system + " gas boiler", carrier=heat_system + " gas boiler",
efficiency=costs.at[f"{heat_system.system_type} gas boiler", "efficiency"], efficiency=costs.at[
f"{heat_system.system_type} gas boiler", "efficiency"
],
efficiency2=costs.at["gas", "CO2 intensity"], efficiency2=costs.at["gas", "CO2 intensity"],
capital_cost=( capital_cost=(
costs.at[f"{heat_system.system_type} gas boiler", "efficiency"] costs.at[f"{heat_system.system_type} gas boiler", "efficiency"]

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
import sys
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import xarray as xr import xarray as xr
@ -12,8 +14,6 @@ from DecentralHeatingCopApproximator import DecentralHeatingCopApproximator
from scripts.enums.HeatSystemType import HeatSystemType from scripts.enums.HeatSystemType import HeatSystemType
import sys
sys.path.append("..") sys.path.append("..")