diff --git a/envs/environment.yaml b/envs/environment.yaml index 9d800fdc..68540801 100644 --- a/envs/environment.yaml +++ b/envs/environment.yaml @@ -56,3 +56,4 @@ dependencies: - pip: - tsam>=1.1.0 + - git+https://github.com/PyPSA/PyPSA.git@master diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index ea749cbc..f0fd80eb 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -402,6 +402,10 @@ def clustering_for_n_clusters( else: busmap = custom_busmap + line_strategies = aggregation_strategies.get("lines", dict()) + generator_strategies = aggregation_strategies.get("generators", dict()) + one_port_strategies = aggregation_strategies.get("one_ports", dict()) + clustering = get_clustering_from_busmap( n, busmap, @@ -409,7 +413,9 @@ def clustering_for_n_clusters( aggregate_generators_carriers=aggregate_carriers, aggregate_one_ports=["Load", "StorageUnit"], line_length_factor=line_length_factor, - generator_strategies=aggregation_strategies["generators"], + line_strategies=line_strategies, + generator_strategies=generator_strategies, + one_port_strategies=one_port_strategies, scale_link_capital_costs=False, ) diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index 9315342f..9fce8e06 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -481,6 +481,10 @@ def aggregate_to_substations(n, aggregation_strategies=dict(), buses_i=None): busmap = n.buses.index.to_series() busmap.loc[buses_i] = dist.idxmin(1) + line_strategies = aggregation_strategies.get("lines", dict()) + generator_strategies = aggregation_strategies.get("generators", dict()) + one_port_strategies = aggregation_strategies.get("one_ports", dict()) + clustering = get_clustering_from_busmap( n, busmap, @@ -488,7 +492,9 @@ def aggregate_to_substations(n, aggregation_strategies=dict(), buses_i=None): aggregate_generators_carriers=None, aggregate_one_ports=["Load", "StorageUnit"], line_length_factor=1.0, - generator_strategies=aggregation_strategies["generators"], + line_strategies=line_strategies, + generator_strategies=generator_strategies, + one_port_strategies=one_port_strategies, scale_link_capital_costs=False, ) return clustering.network, busmap