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.
This commit is contained in:
Koen van Greevenbroek 2021-11-19 14:21:30 +01:00
parent f93ec5a381
commit 04e62fd52e

View File

@ -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"