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]}") +