From d7935e1c065f8a0437190bb691e88a6a0e44272e Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Sun, 18 Feb 2024 09:45:37 +0100 Subject: [PATCH 1/2] revert part of #925 so that config.default.yaml is still copied and config.yaml remains untracked --- Snakefile | 10 +++++++--- config/config.yaml | 8 -------- 2 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 config/config.yaml diff --git a/Snakefile b/Snakefile index ee24841a..ca3e4c49 100644 --- a/Snakefile +++ b/Snakefile @@ -1,9 +1,9 @@ -# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors +# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors # # SPDX-License-Identifier: MIT -from os.path import normpath -from shutil import move, rmtree +from os.path import normpath, exists +from shutil import copyfile, move, rmtree from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider @@ -13,6 +13,10 @@ from snakemake.utils import min_version min_version("7.7") +conf_file = os.path.join(workflow.current_basedir, "config/config.yaml") +conf_default_file = os.path.join(workflow.current_basedir, "config/config.default.yaml") +if not exists(conf_file) and exists(conf_default_file): + copyfile(conf_default_file, conf_file) configfile: "config/config.default.yaml" configfile: "config/config.yaml" diff --git a/config/config.yaml b/config/config.yaml deleted file mode 100644 index efe2ccb2..00000000 --- a/config/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-FileCopyrightText: : 2024 The PyPSA-Eur Authors -# -# SPDX-License-Identifier: CC0-1.0 -# add your own configuration overrides here, for instance - -version: 0.9.0 -# enable: -# retrieve: false From 3e612950c203f6c2774df7b4c71a185f8541d75d Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Sun, 18 Feb 2024 09:45:37 +0100 Subject: [PATCH 2/2] revert part of #925 so that config.default.yaml is still copied and config.yaml remains untracked --- Snakefile | 10 +++++++--- config/config.yaml | 8 -------- doc/release_notes.rst | 3 +-- 3 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 config/config.yaml diff --git a/Snakefile b/Snakefile index ee24841a..ca3e4c49 100644 --- a/Snakefile +++ b/Snakefile @@ -1,9 +1,9 @@ -# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors +# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors # # SPDX-License-Identifier: MIT -from os.path import normpath -from shutil import move, rmtree +from os.path import normpath, exists +from shutil import copyfile, move, rmtree from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider @@ -13,6 +13,10 @@ from snakemake.utils import min_version min_version("7.7") +conf_file = os.path.join(workflow.current_basedir, "config/config.yaml") +conf_default_file = os.path.join(workflow.current_basedir, "config/config.default.yaml") +if not exists(conf_file) and exists(conf_default_file): + copyfile(conf_default_file, conf_file) configfile: "config/config.default.yaml" configfile: "config/config.yaml" diff --git a/config/config.yaml b/config/config.yaml deleted file mode 100644 index efe2ccb2..00000000 --- a/config/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-FileCopyrightText: : 2024 The PyPSA-Eur Authors -# -# SPDX-License-Identifier: CC0-1.0 -# add your own configuration overrides here, for instance - -version: 0.9.0 -# enable: -# retrieve: false diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 7feb4d72..68148086 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -34,8 +34,7 @@ Upcoming Release applied. * The default configuration ``config/config.default.yaml`` is now automatically - used as a base configuration file and no longer copied to - ``config/config.yaml`` on first use. The file ``config/config.yaml`` should be + used as a base configuration file. The file ``config/config.yaml`` should be used to define deviations from the default configuration. * Merged two OPSD time series data versions into such that the option ``load: