Skip to content

Commit 378e998

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e5abe49 commit 378e998

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

scripts/pypsa-de/add_district_heating_subnodes.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44

55
import os
66
import sys
7+
from typing import Dict, List
78

89
import geopandas as gpd
910
import pandas as pd
1011
import pypsa
1112
import xarray as xr
12-
from typing import Dict, List
13-
14-
import os
15-
import sys
1613

1714
sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))
1815

@@ -156,13 +153,13 @@ def add_loads(
156153
)
157154

158155
# Adjust loads of cluster buses
159-
n.loads_t.p_set.loc[
160-
:, f'{subnode["cluster"]} urban central heat'
161-
] -= urban_central_heat_load
156+
n.loads_t.p_set.loc[:, f"{subnode['cluster']} urban central heat"] -= (
157+
urban_central_heat_load
158+
)
162159

163-
n.loads.loc[
164-
f'{subnode["cluster"]} low-temperature heat for industry', "p_set"
165-
] -= low_temperature_heat_for_industry_load
160+
n.loads.loc[f"{subnode['cluster']} low-temperature heat for industry", "p_set"] -= (
161+
low_temperature_heat_for_industry_load
162+
)
166163

167164
if lost_load > 0:
168165
lost_load_subnode = subnode["yearly_heat_demand_MWh"] - (
@@ -506,6 +503,7 @@ def add_subnodes(
506503
Dictionary mapping heat sources to paths with potential data.
507504
output_path : str
508505
Path to save the subnodes_head GeoDataFrame.
506+
509507
Returns
510508
-------
511509
None
@@ -525,7 +523,7 @@ def add_subnodes(
525523

526524
# Add subnodes to network
527525
for _, subnode in subnodes_head.iterrows():
528-
name = f'{subnode["cluster"]} {subnode["Stadt"]} urban central'
526+
name = f"{subnode['cluster']} {subnode['Stadt']} urban central"
529527

530528
# Add different component types
531529
add_buses(n, subnode, name)

0 commit comments

Comments
 (0)