Skip to content

Commit d6aca0b

Browse files
committed
adjust to new naming of wind generators with resource classes
1 parent 89f9ecc commit d6aca0b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/pypsa-de/modify_prenetwork.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,10 @@ def force_connection_nep_offshore(n, current_year, costs):
10451045
# WARNING this code adds a new generator for the offwind connection
10461046
# at an onshore locations. These extra capacities are not accounted
10471047
# for in the land use constraint
1048+
if not snakemake.config["renewable"]["offwind-dc"]["resource_classes"] == 1:
1049+
logger.warning(
1050+
"Number of offshore wind resource classes are not equal to 0. Assigning all offshore wind from NEP to class 0."
1051+
)
10481052

10491053
# Load shapes and projects
10501054
offshore = pd.read_csv(snakemake.input.offshore_connection_points, index_col=0)
@@ -1080,7 +1084,7 @@ def force_connection_nep_offshore(n, current_year, costs):
10801084
nordsee_duck_node = regions_offshore.index[
10811085
regions_offshore.contains(Point(6.19628, 54.38543))
10821086
][0]
1083-
nordsee_duck_off = f"{nordsee_duck_node} offwind-dc-{current_year}"
1087+
nordsee_duck_off = f"{nordsee_duck_node} 0 offwind-dc-{current_year}"
10841088

10851089
dc_projects = goffshore[
10861090
(goffshore.Inbetriebnahmejahr > current_year - 5)
@@ -1109,7 +1113,7 @@ def force_connection_nep_offshore(n, current_year, costs):
11091113
logger.info(f"Forcing in NEP offshore DC projects with capacity:\n {dc_power}")
11101114

11111115
for node in dc_power.index:
1112-
node_off = f"{node} offwind-dc-{current_year}"
1116+
node_off = f"{node} 0 offwind-dc-{current_year}"
11131117

11141118
if node_off not in n.generators.index:
11151119
logger.info(f"Adding generator {node_off}")
@@ -1137,7 +1141,7 @@ def force_connection_nep_offshore(n, current_year, costs):
11371141
]
11381142
for existing in existings:
11391143
node = n.generators.at[existing, "bus"]
1140-
node_off = f"{node} offwind-dc-{current_year}"
1144+
node_off = f"{node} 0 offwind-dc-{current_year}"
11411145
if node_off not in n.generators.index:
11421146
logger.info(f"adding for dummy land constraint {node_off}")
11431147
n.generators.loc[node_off] = n.generators.loc[nordsee_duck_off]
@@ -1178,7 +1182,7 @@ def force_connection_nep_offshore(n, current_year, costs):
11781182
logger.info(f"Forcing in NEP offshore AC projects with capacity:\n {ac_power}")
11791183

11801184
for node in ac_power.index:
1181-
node_off = f"{node} offwind-ac-{current_year}"
1185+
node_off = f"{node} 0 offwind-ac-{current_year}"
11821186

11831187
if node_off not in n.generators.index:
11841188
logger.error(

0 commit comments

Comments
 (0)