cluster_network: replace np.sum/np.min by pandas.Series.sum/min
This commit is contained in:
parent
071350c33f
commit
1f788e0d5b
@ -263,9 +263,9 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr
|
||||
algorithm="kmeans", extended_link_costs=0, focus_weights=None):
|
||||
|
||||
if potential_mode == 'simple':
|
||||
p_nom_max_strategy = np.sum
|
||||
p_nom_max_strategy = pd.Series.sum
|
||||
elif potential_mode == 'conservative':
|
||||
p_nom_max_strategy = np.min
|
||||
p_nom_max_strategy = pd.Series.min
|
||||
else:
|
||||
raise AttributeError(f"potential_mode should be one of 'simple' or 'conservative' but is '{potential_mode}'")
|
||||
|
||||
@ -281,7 +281,7 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr
|
||||
aggregate_generators_carriers=aggregate_carriers,
|
||||
aggregate_one_ports=["Load", "StorageUnit"],
|
||||
line_length_factor=line_length_factor,
|
||||
generator_strategies={'p_nom_max': p_nom_max_strategy, 'p_nom_min': np.sum},
|
||||
generator_strategies={'p_nom_max': p_nom_max_strategy, 'p_nom_min': pd.Series.sum},
|
||||
scale_link_capital_costs=False)
|
||||
|
||||
if not n.links.empty:
|
||||
|
Loading…
Reference in New Issue
Block a user