update enviromnent yaml to install pypsa from master

cluster: allow custom strategies for all components
This commit is contained in:
Fabian 2023-07-17 14:03:16 +02:00
parent 8e568cee03
commit d22c87419b
3 changed files with 15 additions and 2 deletions

View File

@ -56,3 +56,4 @@ dependencies:
- pip: - pip:
- tsam>=1.1.0 - tsam>=1.1.0
- git+https://github.com/PyPSA/PyPSA.git@master

View File

@ -402,6 +402,10 @@ def clustering_for_n_clusters(
else: else:
busmap = custom_busmap 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( clustering = get_clustering_from_busmap(
n, n,
busmap, busmap,
@ -409,7 +413,9 @@ def clustering_for_n_clusters(
aggregate_generators_carriers=aggregate_carriers, aggregate_generators_carriers=aggregate_carriers,
aggregate_one_ports=["Load", "StorageUnit"], aggregate_one_ports=["Load", "StorageUnit"],
line_length_factor=line_length_factor, 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, scale_link_capital_costs=False,
) )

View File

@ -481,6 +481,10 @@ def aggregate_to_substations(n, aggregation_strategies=dict(), buses_i=None):
busmap = n.buses.index.to_series() busmap = n.buses.index.to_series()
busmap.loc[buses_i] = dist.idxmin(1) 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( clustering = get_clustering_from_busmap(
n, n,
busmap, busmap,
@ -488,7 +492,9 @@ def aggregate_to_substations(n, aggregation_strategies=dict(), buses_i=None):
aggregate_generators_carriers=None, aggregate_generators_carriers=None,
aggregate_one_ports=["Load", "StorageUnit"], aggregate_one_ports=["Load", "StorageUnit"],
line_length_factor=1.0, 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, scale_link_capital_costs=False,
) )
return clustering.network, busmap return clustering.network, busmap