From 2433c00dcba8162b8068fbfa2e2029e60646b560 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 13:52:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- config/config.default.yaml | 4 ++-- scripts/solve_network.py | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 7293218f..2fc67baa 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -345,7 +345,7 @@ solar_thermal: # only relevant for foresight = myopic or perfect existing_capacities: - unit_commitment: True # if unit commitment (UC) for conventional power plants is used + unit_commitment: true # if unit commitment (UC) for conventional power plants is used # UC is only applied to extendable plants if linearized UC is used grouping_years_power: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2020, 2025, 2030] grouping_years_heat: [1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2019] # these should not extend 2020 @@ -625,7 +625,7 @@ solving: options: formulation: kirchhoff clip_p_max_pu: 1.e-2 - linearized_unit_commitment: True + linearized_unit_commitment: true load_shedding: false noisy_costs: true skip_iterations: true diff --git a/scripts/solve_network.py b/scripts/solve_network.py index e66e5b65..0dbf8c8e 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -599,13 +599,13 @@ def add_unit_committment(n): Add unit commitment. """ c = "Link" if ("sector_opts" in snakemake.wildcards.keys()) else "Generator" - uc_data = pd.read_csv("/home/lisa/Documents/pypsa-eur/data/unit_committment.csv", - index_col=0) + uc_data = pd.read_csv( + "/home/lisa/Documents/pypsa-eur/data/unit_committment.csv", index_col=0 + ) for attr in uc_data.index: n.df(c)[attr] = n.df(c)["carrier"].map(uc_data.loc[attr]) - def solve_network(n, config, opts="", **kwargs): set_of_options = config["solving"]["solver"]["options"] solver_options = ( @@ -653,7 +653,8 @@ def solve_network(n, config, opts="", **kwargs): return n -#%% + +# %% if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake