Merge pull request #781 from PyPSA/doc/focus_weights

add focus_weights to documentation
This commit is contained in:
Fabian Neumann 2023-11-23 12:02:38 +01:00 committed by GitHub
commit f3832521c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,8 @@ remote:
ssh: ""
path: ""
focus_weights: false
# docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run
run:
name: ""

View File

@ -10,3 +10,4 @@ private,,,
remote,,,
-- ssh,--,,Optionally specify the SSH of a remote cluster to be synchronized.
-- path,--,,Optionally specify the file path within the remote cluster to be synchronized.
focus_weights,,,Optionally specify the focus weights for the clustering of countries. For instance: `DE: 0.8` will distribute 80% of all nodes to Germany and 20% to the rest of the countries.

1 Unit Values Description
10 remote
11 -- ssh -- Optionally specify the SSH of a remote cluster to be synchronized.
12 -- path -- Optionally specify the file path within the remote cluster to be synchronized.
13 focus_weights Optionally specify the focus weights for the clustering of countries. For instance: `DE: 0.8` will distribute 80% of all nodes to Germany and 20% to the rest of the countries.

View File

@ -237,7 +237,7 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name="cbc"):
n_clusters >= len(N) and n_clusters <= N.sum()
), f"Number of clusters must be {len(N)} <= n_clusters <= {N.sum()} for this selection of countries."
if focus_weights is not None:
if isinstance(focus_weights, dict):
total_focus = sum(list(focus_weights.values()))
assert (