add feature: aggregate carrier exclusion
This commit is contained in:
parent
aac7f6681b
commit
24e008a98e
@ -261,6 +261,7 @@ clustering:
|
||||
cluster_network:
|
||||
algorithm: kmeans
|
||||
feature: solar+onwind-time
|
||||
exclude_carriers: [] # list of carriers which will not be aggregated. If empty, all carriers will be aggregated.
|
||||
aggregation_strategies:
|
||||
generators:
|
||||
p_nom_max: sum # use "min" for more conservative assumptions
|
||||
|
@ -191,6 +191,7 @@ clustering:
|
||||
cluster_network:
|
||||
algorithm: kmeans
|
||||
feature: solar+onwind-time
|
||||
exclude_carriers: [] # list of carriers which will not be aggregated. If empty, all carriers will be aggregated.
|
||||
aggregation_strategies:
|
||||
generators:
|
||||
p_nom_max: sum # use "min" for more conservative assumptions
|
||||
|
@ -393,15 +393,14 @@ if __name__ == "__main__":
|
||||
for tech in n.generators.carrier.unique()
|
||||
if tech in snakemake.config['renewable']])
|
||||
|
||||
aggregate_carriers=set(n.carriers.index)-set(snakemake.config["clustering"]["exclude_carriers"])
|
||||
if snakemake.wildcards.clusters.endswith('m'):
|
||||
n_clusters = int(snakemake.wildcards.clusters[:-1])
|
||||
aggregate_carriers = snakemake.config["electricity"].get("conventional_carriers")
|
||||
elif snakemake.wildcards.clusters == 'all':
|
||||
n_clusters = len(n.buses)
|
||||
aggregate_carriers = None # All
|
||||
else:
|
||||
n_clusters = int(snakemake.wildcards.clusters)
|
||||
aggregate_carriers = None # All
|
||||
|
||||
if n_clusters == len(n.buses):
|
||||
# Fast-path if no clustering is necessary
|
||||
|
@ -197,7 +197,7 @@ def _adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus, out
|
||||
|
||||
def _aggregate_and_move_components(n, busmap, connection_costs_to_bus, output,
|
||||
aggregate_one_ports={"Load", "StorageUnit"},
|
||||
aggregation_strategies=dict()):
|
||||
aggregation_strategies=dict(), exclude_carriers=None):
|
||||
|
||||
def replace_components(n, c, df, pnl):
|
||||
n.mremove(c, n.df(c).index)
|
||||
@ -210,9 +210,10 @@ def _aggregate_and_move_components(n, busmap, connection_costs_to_bus, output,
|
||||
_adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus, output)
|
||||
|
||||
_, generator_strategies = get_aggregation_strategies(aggregation_strategies)
|
||||
|
||||
|
||||
carriers=set(n.carriers.index)-set(exclude_carriers)
|
||||
generators, generators_pnl = aggregategenerators(
|
||||
n, busmap, custom_strategies=generator_strategies
|
||||
n, busmap, carriers=carriers, custom_strategies=generator_strategies
|
||||
)
|
||||
|
||||
replace_components(n, "Generator", generators, generators_pnl)
|
||||
@ -320,8 +321,9 @@ def simplify_links(n, costs, config, output, aggregation_strategies=dict()):
|
||||
|
||||
logger.debug("Collecting all components using the busmap")
|
||||
|
||||
exclude_carriers=config["clustering"]["exclude_carriers"]
|
||||
_aggregate_and_move_components(n, busmap, connection_costs_to_bus, output,
|
||||
aggregation_strategies=aggregation_strategies)
|
||||
aggregation_strategies=aggregation_strategies, exclude_carriers=exclude_carriers)
|
||||
return n, busmap
|
||||
|
||||
def remove_stubs(n, costs, config, output, aggregation_strategies=dict()):
|
||||
@ -331,8 +333,9 @@ def remove_stubs(n, costs, config, output, aggregation_strategies=dict()):
|
||||
|
||||
connection_costs_to_bus = _compute_connection_costs_to_bus(n, busmap, costs, config)
|
||||
|
||||
exclude_carriers=config["clustering"]["exclude_carriers"]
|
||||
_aggregate_and_move_components(n, busmap, connection_costs_to_bus, output,
|
||||
aggregation_strategies=aggregation_strategies)
|
||||
aggregation_strategies=aggregation_strategies, exclude_carriers=exclude_carriers)
|
||||
|
||||
return n, busmap
|
||||
|
||||
|
@ -189,6 +189,7 @@ clustering:
|
||||
cluster_network:
|
||||
algorithm: kmeans
|
||||
feature: solar+onwind-time
|
||||
exclude_carriers: ["OCGT", "offwind-ac", "coal"]
|
||||
aggregation_strategies:
|
||||
generators:
|
||||
p_nom_max: sum # use "min" for more conservative assumptions
|
||||
|
Loading…
Reference in New Issue
Block a user