From 85d01bceb0dd87fb0d02648cd70d753450175f62 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 14:34:47 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/configtables/clustering.csv | 2 +- scripts/cluster_network.py | 4 +++- scripts/simplify_network.py | 10 +++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/configtables/clustering.csv b/doc/configtables/clustering.csv index 1ef6e21b..bcab264a 100644 --- a/doc/configtables/clustering.csv +++ b/doc/configtables/clustering.csv @@ -12,4 +12,4 @@ aggregation_strategies,,, -- generators,,, -- -- {key},str,"{key} can be any of the component of the generator (str). It’s value can be any that can be converted to pandas.Series using getattr(). For example one of {min, max, sum}.","Aggregates the component according to the given strategy. For example, if sum, then all values within each cluster are summed to represent the new generator." -- buses,,, --- -- {key},str,"{key} can be any of the component of the bus (str). It’s value can be any that can be converted to pandas.Series using getattr(). For example one of {min, max, sum}.","Aggregates the component according to the given strategy. For example, if sum, then all values within each cluster are summed to represent the new bus." \ No newline at end of file +-- -- {key},str,"{key} can be any of the component of the bus (str). It’s value can be any that can be converted to pandas.Series using getattr(). For example one of {min, max, sum}.","Aggregates the component according to the given strategy. For example, if sum, then all values within each cluster are summed to represent the new bus." diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 32e89273..63fec077 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -475,7 +475,9 @@ if __name__ == "__main__": ] ) - exclude_carriers = snakemake.config["clustering"]["cluster_network"].get("exclude_carriers", []) + exclude_carriers = snakemake.config["clustering"]["cluster_network"].get( + "exclude_carriers", [] + ) aggregate_carriers = set(n.generators.carrier) - set(exclude_carriers) if snakemake.wildcards.clusters.endswith("m"): n_clusters = int(snakemake.wildcards.clusters[:-1]) diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index 959c84e8..2c7f8413 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -245,7 +245,7 @@ def _aggregate_and_move_components( _adjust_capital_costs_using_connection_costs(n, connection_costs_to_bus, output) _, generator_strategies = get_aggregation_strategies(aggregation_strategies) - + carriers = set(n.generators.carrier) - set(exclude_carriers) generators, generators_pnl = aggregategenerators( n, busmap, carriers=carriers, custom_strategies=generator_strategies @@ -377,7 +377,9 @@ def simplify_links(n, costs, config, output, aggregation_strategies=dict()): logger.debug("Collecting all components using the busmap") - exclude_carriers = config["clustering"]["simplify_network"].get("exclude_carriers", []) + exclude_carriers = config["clustering"]["simplify_network"].get( + "exclude_carriers", [] + ) _aggregate_and_move_components( n, @@ -397,7 +399,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"]["simplify_network"].get("exclude_carriers", []) + exclude_carriers = config["clustering"]["simplify_network"].get( + "exclude_carriers", [] + ) _aggregate_and_move_components( n,