Skip to content

Commit

Permalink
Update configuration system (#292).
Browse files Browse the repository at this point in the history
  • Loading branch information
euronion committed Dec 2, 2021
1 parent 1da908b commit 4bd4e34
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Snakefile
@@ -1,17 +1,28 @@
# SPDX-FileCopyrightText: : 2017-2020 The PyPSA-Eur Authors
# SPDX-FileCopyrightText: : 2017-2021 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT

from os.path import normpath, exists
from shutil import copyfile
from pathlib import Path
from snakemake.utils import update_config
from snakemake.io import load_configfile

from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
HTTP = HTTPRemoteProvider()

if not exists("config.yaml"):
copyfile("config.default.yaml", "config.yaml")
## ++ Configuration setup ++ ##
# Specify your custom configuration file here
configfile: "config/config.tutorial.yaml"

configfile: "config.yaml"
# Default configuration - DO NOT CHANGE
default_configfile="config/config.default.yaml"

# Load default config and overwrite with specific config
specific_config = config.copy()
config = load_configfile(Path(default_configfile))
update_config(config, specific_config)
## -- Configuration setup -- ##

COSTS="data/costs.csv"
ATLITE_NPROCESSES = config['atlite'].get('nprocesses', 4)
Expand All @@ -23,7 +34,6 @@ wildcard_constraints:
ll="(v|c)([0-9\.]+|opt|all)|all",
opts="[-+a-zA-Z0-9\.]*"


rule cluster_all_networks:
input: expand("networks/elec_s{simpl}_{clusters}.nc", **config['scenario'])

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 4bd4e34

Please sign in to comment.