[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-07-29 16:33:49 +00:00
parent 81618d4be1
commit 1fe54513cd
4 changed files with 17 additions and 8 deletions

View File

@ -418,10 +418,10 @@ sector:
heat_loss: 0.0
heat_pump_sources:
central:
- air
- air
decentral:
- air
- ground
- air
- ground
cluster_heat_buses: true
heat_demand_cutout: default
bev_dsm_restriction_value: 0.75

View File

@ -214,6 +214,7 @@ rule build_temperature_profiles:
script:
"../scripts/build_temperature_profiles.py"
# def output_cop(wildcards):
# return {
# f"cop_{source}_{sink}": resources(
@ -222,6 +223,7 @@ rule build_temperature_profiles:
# for sink, source in config["sector"]["heat_pump_sources"].items()
# }
rule build_cop_profiles:
params:
heat_pump_sink_T_decentral_heating=config_provider(

View File

@ -445,7 +445,9 @@ def add_heating_capacities_installed_before_baseyear(
for heat_system in existing_heating.columns.get_level_values(0).unique():
system_type = "central" if heat_system == "urban central" else "decentral"
nodes = pd.Index(n.buses.location[n.buses.index.str.contains(f"{heat_system} heat")])
nodes = pd.Index(
n.buses.location[n.buses.index.str.contains(f"{heat_system} heat")]
)
if (system_type != "central") and options["electricity_distribution_grid"]:
nodes_elec = nodes + " low voltage"
@ -457,12 +459,13 @@ def add_heating_capacities_installed_before_baseyear(
costs_name = f"{system_type} {heat_source}-sourced heat pump"
efficiency = (
cop.sel(heat_system=system_type, heat_source=heat_source, name=nodes).to_pandas().reindex(index=n.snapshots)
cop.sel(heat_system=system_type, heat_source=heat_source, name=nodes)
.to_pandas()
.reindex(index=n.snapshots)
if options["time_dep_hp_cop"]
else costs.at[costs_name, "efficiency"]
)
too_large_grouping_years = [gy for gy in grouping_years if gy >= int(baseyear)]
if too_large_grouping_years:
logger.warning(
@ -498,7 +501,9 @@ def add_heating_capacities_installed_before_baseyear(
efficiency=efficiency,
capital_cost=costs.at[costs_name, "efficiency"]
* costs.at[costs_name, "fixed"],
p_nom=existing_heating.loc[nodes, (heat_system, f"{heat_source} heat pump")]
p_nom=existing_heating.loc[
nodes, (heat_system, f"{heat_source} heat pump")
]
* ratio
/ costs.at[costs_name, "efficiency"],
build_year=int(grouping_year),

View File

@ -1913,7 +1913,9 @@ def add_heat(n, costs):
for heat_source in snakemake.params.heat_pump_sources[system_type]:
costs_name = f"{system_type} {heat_source}-sourced heat pump"
efficiency = (
cop.sel(heat_system=system_type, heat_source=heat_source, name=nodes).to_pandas().reindex(index=n.snapshots)
cop.sel(heat_system=system_type, heat_source=heat_source, name=nodes)
.to_pandas()
.reindex(index=n.snapshots)
if options["time_dep_hp_cop"]
else costs.at[costs_name, "efficiency"]
)