Skip to content

Commit 25de4e0

Browse files
Restricting network topology to interconnectors only (#141)
* restricting network topology to interconnectors only * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3766b85 commit 25de4e0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

scripts/prepare_sector_network.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,13 @@ def create_network_topology(
412412
lk_attrs = n.links.columns.intersection(lk_attrs)
413413

414414
candidates = pd.concat(
415-
[n.lines[ln_attrs], n.links.loc[n.links.carrier.isin(carriers), lk_attrs]]
415+
[
416+
n.lines[ln_attrs],
417+
n.links.loc[
418+
(n.links.carrier.isin(carriers)) & (n.links.underwater_fraction > 0.1),
419+
lk_attrs,
420+
],
421+
]
416422
).fillna(0)
417423

418424
# base network topology purely on location not carrier
@@ -4252,7 +4258,7 @@ def add_biomass(
42524258
transport_costs = pd.read_csv(biomass_transport_costs_file, index_col=0)
42534259
transport_costs = transport_costs.squeeze()
42544260
biomass_transport = create_network_topology(
4255-
n, "biomass transport ", bidirectional=False
4261+
n, "biomass transport ", carriers=[""], bidirectional=False
42564262
)
42574263

42584264
# costs

scripts/pypsa-de/additional_functionality.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def add_capacity_limits(n, investment_year, limits_capacity, sense="maximum"):
3737
valid_components & ~c.static[attr + "_nom_extendable"]
3838
]
3939
extendable_index = c.static.index[
40-
valid_components & c.static[attr + "_nom_extendable"] & c.static.active
40+
valid_components
41+
& c.static[attr + "_nom_extendable"]
42+
& c.static.active
4143
]
4244

4345
existing_capacity = c.static.loc[existing_index, attr + "_nom"].sum()

0 commit comments

Comments
 (0)