pypsa-eur/scripts/copy_config.py
Fabian 1bf6ea1532 only copy active configuration to results folder
use copy config for all solve rules
remove copying of environment
2023-08-02 14:49:32 +02:00

28 lines
651 B
Python

# -*- coding: utf-8 -*-
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
"""
Copy used configuration files and important scripts for archiving.
"""
from pathlib import Path
from shutil import copy
import yaml
if __name__ == "__main__":
if "snakemake" not in globals():
from _helpers import mock_snakemake
snakemake = mock_snakemake("copy_config")
with open(snakemake.output[0], "w") as yaml_file:
yaml.dump(
snakemake.config,
yaml_file,
default_flow_style=False,
allow_unicode=True,
sort_keys=False,
)