Skip to content

Commit 89f9ecc

Browse files
committed
simplify nep_costs
1 parent 9e17e5c commit 89f9ecc

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

scripts/pypsa-de/modify_prenetwork.py

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,30 +1041,11 @@ def enforce_transmission_project_build_years(n, current_year):
10411041
n.links.loc[dc_future, "p_nom_max"] = 0.0
10421042

10431043

1044-
def force_connection_nep_offshore(n, current_year):
1044+
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
10481048

1049-
# Load costs
1050-
nep23_costs = (
1051-
pd.read_csv(
1052-
snakemake.input.costs_modifications,
1053-
index_col=0,
1054-
)
1055-
.query(
1056-
"""
1057-
source == 'NEP2023' \
1058-
& technology.str.contains('offwind') \
1059-
& parameter == 'investment'
1060-
"""
1061-
)
1062-
.rename(columns={"value": "investment"})
1063-
)
1064-
# kW to MW
1065-
nep23_costs.at["offwind-ac-station", "investment"] *= 1000
1066-
nep23_costs.at["offwind-dc-station", "investment"] *= 1000
1067-
10681049
# Load shapes and projects
10691050
offshore = pd.read_csv(snakemake.input.offshore_connection_points, index_col=0)
10701051

@@ -1112,10 +1093,10 @@ def force_connection_nep_offshore(n, current_year):
11121093
dc_connection_totals = (
11131094
dc_projects["Trassenlänge in km"]
11141095
* (
1115-
2 / 3 * nep23_costs.at["offwind-dc-connection-submarine", "investment"]
1116-
+ 1 / 3 * nep23_costs.at["offwind-dc-connection-underground", "investment"]
1096+
2 / 3 * costs.at["offwind-dc-connection-submarine", "investment"]
1097+
+ 1 / 3 * costs.at["offwind-dc-connection-underground", "investment"]
11171098
)
1118-
+ nep23_costs.at["offwind-dc-station", "investment"]
1099+
+ costs.at["offwind-dc-station", "investment"]
11191100
) * dc_projects["Übertragungsleistung in MW"]
11201101

11211102
dc_connection_overnight_costs = (
@@ -1181,10 +1162,10 @@ def force_connection_nep_offshore(n, current_year):
11811162
ac_connection_totals = (
11821163
ac_projects["Trassenlänge in km"]
11831164
* (
1184-
2 / 3 * nep23_costs.at["offwind-ac-connection-submarine", "investment"]
1185-
+ 1 / 3 * nep23_costs.at["offwind-ac-connection-underground", "investment"]
1165+
2 / 3 * costs.at["offwind-ac-connection-submarine", "investment"]
1166+
+ 1 / 3 * costs.at["offwind-ac-connection-underground", "investment"]
11861167
)
1187-
+ nep23_costs.at["offwind-ac-station", "investment"]
1168+
+ costs.at["offwind-ac-station", "investment"]
11881169
) * ac_projects["Übertragungsleistung in MW"]
11891170

11901171
ac_connection_overnight_costs = (
@@ -1356,7 +1337,7 @@ def scale_capacity(n, scaling):
13561337

13571338
drop_duplicate_transmission_projects(n)
13581339

1359-
force_connection_nep_offshore(n, current_year)
1340+
force_connection_nep_offshore(n, current_year, costs)
13601341

13611342
scale_capacity(n, snakemake.params.scale_capacity)
13621343

0 commit comments

Comments
 (0)