From 04e62fd52e3b0d0ff28be74fe4eccf04b6494abf Mon Sep 17 00:00:00 2001 From: Koen van Greevenbroek Date: Fri, 19 Nov 2021 14:21:30 +0100 Subject: [PATCH] Create config file from default if not found Similarly to pypsa-eur, the config file is not found, we create it as a copy of `config.default.yaml`. This also makes it easier to include pypsa-eur-sec as a subworkflow in a snakemake workflow. --- Snakefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Snakefile b/Snakefile index 0b72ae4b..e56d86d2 100644 --- a/Snakefile +++ b/Snakefile @@ -1,7 +1,13 @@ +from os.path import exists +from shutil import copyfile + from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider HTTP = HTTPRemoteProvider() +if not exists("config.yaml"): + copyfile("config.default.yaml", "config.yaml") + configfile: "config.yaml"