From 03322168911d0a0e82c008501df83ab21a78fffa Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 6 Mar 2023 09:46:18 +0100 Subject: [PATCH 1/3] update release notes --- doc/release_notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index f5048ad0..7e7fab1f 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -10,7 +10,7 @@ Release Notes Upcoming Release ================ -* new features +* The solver configuration in `config.default.yaml` are now modularized. To change the set of solver options, change to value in `solving`: `solver`: `options` to one of the keys `solving`: `solver_options`. PyPSA-Eur 0.7.0 (16th February 2023) From bf969424a2fe92514c0656b935f24ffd1a36a40c Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 6 Mar 2023 15:41:02 +0100 Subject: [PATCH 2/3] ci modularization fix cutout retrieval and profile in dag --- Snakefile | 8 +++----- config.default.yaml | 2 +- scripts/add_electricity.py | 2 +- test/config.test1.yaml | 5 +++++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Snakefile b/Snakefile index 5c96c55d..d50dfe8e 100644 --- a/Snakefile +++ b/Snakefile @@ -319,7 +319,7 @@ rule retrieve_ship_raster: rule build_ship_raster: input: ship_density="data/shipdensity_global.zip", - cutouts=expand("cutouts/" + CDIR + "{cutouts}.nc", **config["atlite"]), + cutouts=expand("cutouts/" + CDIR + "{cutout}.nc", cutout=[config["renewable"][k]['cutout'] for k in config['electricity']['renewable_carriers']]) output: "resources/" + RDIR + "shipdensity_raster.nc", log: @@ -381,9 +381,7 @@ rule build_hydro_profile: input: country_shapes="resources/" + RDIR + "country_shapes.geojson", eia_hydro_generation="data/eia_hydro_annual_generation.csv", - cutout=f"cutouts/" + CDIR + config["renewable"]["hydro"]["cutout"] + ".nc" - if "hydro" in config["renewable"] - else [], + cutout=f"cutouts/" + CDIR + config["renewable"]["hydro"]["cutout"] + ".nc", output: "resources/" + RDIR + "profile_hydro.nc", log: @@ -398,7 +396,7 @@ rule add_electricity: input: **{ f"profile_{tech}": "resources/" + RDIR + f"profile_{tech}.nc" - for tech in config["renewable"] + for tech in config["electricity"]["renewable_carriers"] }, **{ f"conventional_{carrier}_{attr}": fn diff --git a/config.default.yaml b/config.default.yaml index 9e98ea01..dc785df4 100755 --- a/config.default.yaml +++ b/config.default.yaml @@ -356,8 +356,8 @@ solving: solutiontype: 2 # non basic solution, ie no crossover barrier_convergetol: 1.e-5 feasopt_tolerance: 1.e-6 - cbc-default: {} # Used in CI + glpk-default: {} # Used in CI mem: 30000 #memory in MB; 20 GB enough for 50+B+I+H2; 100 GB for 181+B+I+H2 diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index 88ea2ada..6daf0111 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -720,7 +720,7 @@ if __name__ == "__main__": ppl = load_powerplants(snakemake.input.powerplants) if "renewable_carriers" in snakemake.config["electricity"]: - renewable_carriers = set(snakemake.config["renewable"]) + renewable_carriers = set(snakemake.config["electricity"]["renewable_carriers"]) else: logger.warning( "Missing key `renewable_carriers` under config entry `electricity`. " diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 5a44a394..5ab22d35 100755 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -23,6 +23,8 @@ electricity: Store: [H2] Link: [H2 pipeline] + renewable_carriers: [solar, onwind, offwind-ac, offwind-dc] + atlite: cutouts: @@ -44,9 +46,12 @@ renewable: solar: cutout: be-03-2013-era5 + clustering: exclude_carriers: ["OCGT", "offwind-ac", "coal"] + solving: solver: name: glpk + options: "glpk-default" From 8db3780fce367aa9643d54eea7ca3e89646273cb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:43:45 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Snakefile | 8 +++++++- doc/release_notes.rst | 2 +- test/config.test1.yaml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Snakefile b/Snakefile index d50dfe8e..c26beb91 100644 --- a/Snakefile +++ b/Snakefile @@ -319,7 +319,13 @@ rule retrieve_ship_raster: rule build_ship_raster: input: ship_density="data/shipdensity_global.zip", - cutouts=expand("cutouts/" + CDIR + "{cutout}.nc", cutout=[config["renewable"][k]['cutout'] for k in config['electricity']['renewable_carriers']]) + cutouts=expand( + "cutouts/" + CDIR + "{cutout}.nc", + cutout=[ + config["renewable"][k]["cutout"] + for k in config["electricity"]["renewable_carriers"] + ], + ), output: "resources/" + RDIR + "shipdensity_raster.nc", log: diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 7e7fab1f..76a794ad 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -10,7 +10,7 @@ Release Notes Upcoming Release ================ -* The solver configuration in `config.default.yaml` are now modularized. To change the set of solver options, change to value in `solving`: `solver`: `options` to one of the keys `solving`: `solver_options`. +* The solver configuration in `config.default.yaml` are now modularized. To change the set of solver options, change to value in `solving`: `solver`: `options` to one of the keys `solving`: `solver_options`. PyPSA-Eur 0.7.0 (16th February 2023) diff --git a/test/config.test1.yaml b/test/config.test1.yaml index 5ab22d35..cf8e06bc 100755 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -46,7 +46,7 @@ renewable: solar: cutout: be-03-2013-era5 - + clustering: exclude_carriers: ["OCGT", "offwind-ac", "coal"]