From f09c6ca269ab7e0dae3da7ead679f6a62f6e5ebb Mon Sep 17 00:00:00 2001 From: Daniel Huppmann Date: Mon, 4 Nov 2024 16:52:32 +0100 Subject: [PATCH] Fix snakemake workflow --- workflow.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/workflow.py b/workflow.py index 276043c..6a1bd34 100644 --- a/workflow.py +++ b/workflow.py @@ -1,12 +1,10 @@ from pathlib import Path -from pyam import IamDataFrame +import pyam from nomenclature import DataStructureDefinition, RegionProcessor, process import logging - here = Path(__file__).absolute().parent - logger = logging.getLogger(__name__) file_handler = logging.FileHandler(snakemake.log[0], mode="a") @@ -20,7 +18,7 @@ logging.getLogger(logger_name).addHandler(file_handler) -def main(df: IamDataFrame) -> IamDataFrame: +def main(df: pyam.IamDataFrame) -> pyam.IamDataFrame: """Project/instance-specific workflow for scenario processing""" # Run the validation and region-processing @@ -28,6 +26,8 @@ def main(df: IamDataFrame) -> IamDataFrame: processor = RegionProcessor.from_directory(path=here / "mappings", dsd=dsd) return process(df, dsd, processor=processor) + logger.info(f"Starting processing for {snakemake.input[0]}") main(pyam.IamDataFrame(snakemake.input[0])).to_excel(snakemake.output[0]) logger.info(f"Successfully finished processing for {snakemake.input[0]}") +