From a860643dd8cd66418b6a6d7893960c636d78ec3b Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Mon, 18 Jul 2022 17:28:09 +0200 Subject: [PATCH] reduce number of columns for simplified and clustered regions --- scripts/cluster_network.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index bd412b7f..1ef2f2e5 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -122,7 +122,7 @@ Exemplary unsolved network clustered to 37 nodes: """ import logging -from _helpers import configure_logging, update_p_nom_max, get_aggregation_strategies, REGION_COLS +from _helpers import configure_logging, update_p_nom_max, get_aggregation_strategies import pypsa import os @@ -372,9 +372,8 @@ def cluster_regions(busmaps, input=None, output=None): for which in ('regions_onshore', 'regions_offshore'): regions = gpd.read_file(getattr(input, which)) - regions = regions.reindex(columns=REGION_COLS).set_index('name') - aggfunc = dict(x="mean", y="mean", country="first") - regions_c = regions.dissolve(busmap, aggfunc=aggfunc) + regions = regions.reindex(columns=["name", "geometry"]).set_index('name') + regions_c = regions.dissolve(busmap) regions_c.index.name = 'name' regions_c = regions_c.reset_index() regions_c.to_file(getattr(output, which))