cluster network: remove bus strategies as already handled internally

This commit is contained in:
Fabian 2023-07-14 16:00:21 +02:00
parent f566142d38
commit 8e568cee03
2 changed files with 2 additions and 8 deletions

View File

@ -139,7 +139,6 @@ from pypsa.clustering.spatial import (
busmap_by_hac, busmap_by_hac,
busmap_by_kmeans, busmap_by_kmeans,
get_clustering_from_busmap, get_clustering_from_busmap,
make_consense,
) )
warnings.filterwarnings(action="ignore", category=UserWarning) warnings.filterwarnings(action="ignore", category=UserWarning)
@ -406,7 +405,6 @@ def clustering_for_n_clusters(
clustering = get_clustering_from_busmap( clustering = get_clustering_from_busmap(
n, n,
busmap, busmap,
bus_strategies={"country": make_consense},
aggregate_generators_weighted=True, aggregate_generators_weighted=True,
aggregate_generators_carriers=aggregate_carriers, aggregate_generators_carriers=aggregate_carriers,
aggregate_one_ports=["Load", "StorageUnit"], aggregate_one_ports=["Load", "StorageUnit"],

View File

@ -86,7 +86,7 @@ The rule :mod:`simplify_network` does up to four things:
""" """
import logging import logging
from functools import reduce from functools import partial, reduce
import numpy as np import numpy as np
import pandas as pd import pandas as pd
@ -99,7 +99,6 @@ from pypsa.clustering.spatial import (
aggregateoneport, aggregateoneport,
busmap_by_stubs, busmap_by_stubs,
get_clustering_from_busmap, get_clustering_from_busmap,
make_consense,
) )
from pypsa.io import import_components_from_dataframe, import_series_from_dataframe from pypsa.io import import_components_from_dataframe, import_series_from_dataframe
from scipy.sparse.csgraph import connected_components, dijkstra from scipy.sparse.csgraph import connected_components, dijkstra
@ -482,17 +481,14 @@ def aggregate_to_substations(n, aggregation_strategies=dict(), buses_i=None):
busmap = n.buses.index.to_series() busmap = n.buses.index.to_series()
busmap.loc[buses_i] = dist.idxmin(1) busmap.loc[buses_i] = dist.idxmin(1)
bus_strategies = {"country": make_consense}
clustering = get_clustering_from_busmap( clustering = get_clustering_from_busmap(
n, n,
busmap, busmap,
bus_strategies=bus_strategies,
aggregate_generators_weighted=True, aggregate_generators_weighted=True,
aggregate_generators_carriers=None, aggregate_generators_carriers=None,
aggregate_one_ports=["Load", "StorageUnit"], aggregate_one_ports=["Load", "StorageUnit"],
line_length_factor=1.0, line_length_factor=1.0,
generator_strategies=generator_strategies, generator_strategies=aggregation_strategies["generators"],
scale_link_capital_costs=False, scale_link_capital_costs=False,
) )
return clustering.network, busmap return clustering.network, busmap