follow-up: rename configs to config

This commit is contained in:
Fabian 2023-04-21 11:05:18 +02:00
parent 1f6f7a2039
commit 97bdbe636c
6 changed files with 13 additions and 13 deletions

View File

@ -103,9 +103,9 @@ jobs:
run: | run: |
conda activate pypsa-eur conda activate pypsa-eur
conda list conda list
snakemake -call solve_elec_networks --configfile configs/test/config.electricity.yaml --rerun-triggers=mtime snakemake -call solve_elec_networks --configfile config/test/config.electricity.yaml --rerun-triggers=mtime
snakemake -call all --configfile configs/test/config.overnight.yaml --rerun-triggers=mtime snakemake -call all --configfile config/test/config.overnight.yaml --rerun-triggers=mtime
snakemake -call all --configfile configs/test/config.myopic.yaml --rerun-triggers=mtime snakemake -call all --configfile config/test/config.myopic.yaml --rerun-triggers=mtime
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -14,11 +14,11 @@ from snakemake.utils import min_version
min_version("7.7") min_version("7.7")
if not exists("configs/config.yaml"): if not exists("config/config.yaml"):
copyfile("configs/config.default.yaml", "configs/config.yaml") copyfile("config/config.default.yaml", "config/config.yaml")
configfile: "configs/config.yaml" configfile: "config/config.yaml"
COSTS = f"data/costs_{config['costs']['year']}.csv" COSTS = f"data/costs_{config['costs']['year']}.csv"

View File

@ -37,7 +37,7 @@ rule copy_config:
params: params:
RDIR=RDIR, RDIR=RDIR,
output: output:
RESULTS + "configs/config.yaml", RESULTS + "config/config.yaml",
threads: 1 threads: 1
resources: resources:
mem_mb=1000, mem_mb=1000,
@ -51,7 +51,7 @@ rule copy_config:
rule copy_conda_env: rule copy_conda_env:
output: output:
RESULTS + "configs/environment.yaml", RESULTS + "config/environment.yaml",
threads: 1 threads: 1
resources: resources:
mem_mb=500, mem_mb=500,

View File

@ -79,7 +79,7 @@ rule solve_sector_network_myopic:
network=RESULTS network=RESULTS
+ "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "prenetworks-brownfield/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
costs="data/costs_{planning_horizons}.csv", costs="data/costs_{planning_horizons}.csv",
config=RESULTS + "configs/config.yaml", config=RESULTS + "config/config.yaml",
output: output:
RESULTS RESULTS
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",

View File

@ -9,8 +9,8 @@ rule solve_sector_network:
network=RESULTS network=RESULTS
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
costs="data/costs_{}.csv".format(config["costs"]["year"]), costs="data/costs_{}.csv".format(config["costs"]["year"]),
config=RESULTS + "configs/config.yaml", config=RESULTS + "config/config.yaml",
#env=RDIR + 'configs/environment.yaml', #env=RDIR + 'config/environment.yaml',
output: output:
RESULTS RESULTS
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", + "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",

View File

@ -12,7 +12,7 @@ from shutil import copy
import yaml import yaml
files = { files = {
"configs/config.yaml": "config.yaml", "config/config.yaml": "config.yaml",
"Snakefile": "Snakefile", "Snakefile": "Snakefile",
"scripts/solve_network.py": "solve_network.py", "scripts/solve_network.py": "solve_network.py",
"scripts/prepare_sector_network.py": "prepare_sector_network.py", "scripts/prepare_sector_network.py": "prepare_sector_network.py",
@ -24,7 +24,7 @@ if __name__ == "__main__":
snakemake = mock_snakemake("copy_config") snakemake = mock_snakemake("copy_config")
basepath = Path(f"results/{snakemake.params.RDIR}configs/") basepath = Path(f"results/{snakemake.params.RDIR}config/")
for f, name in files.items(): for f, name in files.items():
copy(f, basepath / name) copy(f, basepath / name)