[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-02-06 22:28:31 +00:00
parent 2e54f57899
commit e6ecbc95d7
6 changed files with 0 additions and 18 deletions

View File

@ -394,12 +394,10 @@ def attach_conventional_generators(
)
for carrier in conventional_config:
# Generators with technology affected
idx = n.generators.query("carrier == @carrier").index
for attr in list(set(conventional_config[carrier]) & set(n.generators)):
values = conventional_config[carrier][attr]
if f"conventional_{carrier}_{attr}" in conventional_inputs:

View File

@ -694,7 +694,6 @@ def base_network(
parameter_corrections,
config,
):
buses = _load_buses_from_eg(eg_buses, europe_shape, config["electricity"])
links = _load_links_from_eg(buses, eg_links)

View File

@ -268,7 +268,6 @@ def manual_adjustment(load, fn_load, powerstatistics):
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake

View File

@ -238,7 +238,6 @@ def distribute_clusters(n, n_clusters, focus_weights=None, solver_name="cbc"):
), f"Number of clusters must be {len(N)} <= n_clusters <= {N.sum()} for this selection of countries."
if focus_weights is not None:
total_focus = sum(list(focus_weights.values()))
assert (
@ -396,7 +395,6 @@ def clustering_for_n_clusters(
extended_link_costs=0,
focus_weights=None,
):
bus_strategies, generator_strategies = get_aggregation_strategies(
aggregation_strategies
)

View File

@ -164,7 +164,6 @@ def calculate_curtailment(n, label, curtailment):
def calculate_energy(n, label, energy):
for c in n.iterate_components(n.one_port_components | n.branch_components):
if c.name in {"Generator", "Load", "ShuntImpedance"}:
c_energies = (
c.pnl.p.multiply(n.snapshot_weightings.generators, axis=0)
@ -238,7 +237,6 @@ def calculate_supply(n, label, supply):
load_types = n.buses.carrier.unique()
for i in load_types:
buses = n.buses.query("carrier == @i").index
bus_map = pd.Series(False, index=n.buses.index)
@ -246,7 +244,6 @@ def calculate_supply(n, label, supply):
bus_map.loc[buses] = True
for c in n.iterate_components(n.one_port_components):
items = c.df.index[c.df.bus.map(bus_map)]
if len(items) == 0 or c.pnl.p.empty:
@ -267,9 +264,7 @@ def calculate_supply(n, label, supply):
supply.loc[idx[raw_index], label] = s.values
for c in n.iterate_components(n.branch_components):
for end in ["0", "1"]:
items = c.df.index[c.df["bus" + end].map(bus_map)]
if len(items) == 0 or c.pnl["p" + end].empty:
@ -298,7 +293,6 @@ def calculate_supply_energy(n, label, supply_energy):
load_types = n.buses.carrier.unique()
for i in load_types:
buses = n.buses.query("carrier == @i").index
bus_map = pd.Series(False, index=n.buses.index)
@ -306,7 +300,6 @@ def calculate_supply_energy(n, label, supply_energy):
bus_map.loc[buses] = True
for c in n.iterate_components(n.one_port_components):
items = c.df.index[c.df.bus.map(bus_map)]
if len(items) == 0 or c.pnl.p.empty:
@ -327,9 +320,7 @@ def calculate_supply_energy(n, label, supply_energy):
supply_energy.loc[idx[raw_index], label] = s.values
for c in n.iterate_components(n.branch_components):
for end in ["0", "1"]:
items = c.df.index[c.df["bus" + end].map(bus_map)]
if len(items) == 0 or c.pnl["p" + end].empty:
@ -431,7 +422,6 @@ def calculate_weighted_prices(n, label, weighted_prices):
}
for carrier in link_loads:
if carrier == "electricity":
suffix = ""
elif carrier[:5] == "space":
@ -454,7 +444,6 @@ def calculate_weighted_prices(n, label, weighted_prices):
load = n.loads_t.p_set[buses]
for tech in link_loads[carrier]:
names = n.links.index[n.links.index.to_series().str[-len(tech) :] == tech]
if names.empty:

View File

@ -324,7 +324,6 @@ def simplify_links(n, costs, config, output, aggregation_strategies=dict()):
)
for lbl in labels.value_counts().loc[lambda s: s > 2].index:
for b, buses, links in split_links(labels.index[labels == lbl]):
if len(buses) <= 2:
continue