2023-03-06 08:27:45 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2023-03-06 17:49:23 +00:00
|
|
|
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
2023-03-09 11:45:43 +00:00
|
|
|
"""
|
|
|
|
Copy used configuration files and important scripts for archiving.
|
|
|
|
"""
|
|
|
|
|
2023-03-06 08:27:45 +00:00
|
|
|
|
2022-04-12 13:16:05 +00:00
|
|
|
import yaml
|
2023-08-15 14:51:35 +00:00
|
|
|
from _helpers import set_scenario_config
|
2019-05-16 07:39:03 +00:00
|
|
|
|
2023-03-06 08:27:45 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
if "snakemake" not in globals():
|
2023-08-15 14:51:35 +00:00
|
|
|
from _helpers import mock_snakemake
|
2021-07-01 18:09:04 +00:00
|
|
|
|
2023-03-06 08:27:45 +00:00
|
|
|
snakemake = mock_snakemake("copy_config")
|
|
|
|
|
2023-08-15 13:49:57 +00:00
|
|
|
set_scenario_config(snakemake)
|
|
|
|
|
2023-08-02 12:31:08 +00:00
|
|
|
with open(snakemake.output[0], "w") as yaml_file:
|
2022-04-12 13:16:05 +00:00
|
|
|
yaml.dump(
|
|
|
|
snakemake.config,
|
|
|
|
yaml_file,
|
|
|
|
default_flow_style=False,
|
|
|
|
allow_unicode=True,
|
2023-03-06 08:27:45 +00:00
|
|
|
sort_keys=False,
|
|
|
|
)
|