fix custom clustering by checking explicitly for series (#318)

This commit is contained in:
Fabian Neumann 2022-02-27 08:07:11 +01:00 committed by GitHub
parent 3eec027db6
commit 8dafb7bc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,7 +269,7 @@ def clustering_for_n_clusters(n, n_clusters, custom_busmap=False, aggregate_carr
else: else:
raise AttributeError(f"potential_mode should be one of 'simple' or 'conservative' but is '{potential_mode}'") raise AttributeError(f"potential_mode should be one of 'simple' or 'conservative' but is '{potential_mode}'")
if not custom_busmap: if not isinstance(custom_busmap, pd.Series):
busmap = busmap_for_n_clusters(n, n_clusters, solver_name, focus_weights, algorithm) busmap = busmap_for_n_clusters(n, n_clusters, solver_name, focus_weights, algorithm)
else: else:
busmap = custom_busmap busmap = custom_busmap