From cc66bb4dc56bd0c3f6763856d6c26cbe84b68cce Mon Sep 17 00:00:00 2001 From: andreab1997 Date: Tue, 10 Oct 2023 14:46:11 +0200 Subject: [PATCH] Print a warning for the fktables that do not exist during combination --- src/pineko/fonll.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pineko/fonll.py b/src/pineko/fonll.py index 8e2679cc..b05dde42 100644 --- a/src/pineko/fonll.py +++ b/src/pineko/fonll.py @@ -2,6 +2,7 @@ import copy import json +import logging import tempfile from pathlib import Path @@ -12,6 +13,8 @@ from . import configs +logger = logging.getLogger(__name__) + class FONLLInfo: """Class containing all the information for FONLL predictions.""" @@ -44,7 +47,13 @@ def fk_paths(self): "ffns5til": self.ffns5til, "ffns5bar": self.ffns5bar, } - return {p: Path(paths[p]) for p in paths if paths[p] is not None} + actually_existing_paths = [p for p in paths if paths[p] is not None] + for p in paths: + if p not in actually_existing_paths: + logger.warning( + f"Warning! FK table for {p} does not exist and thus is being skipped." + ) + return {p: Path(paths[p]) for p in actually_existing_paths} @property def fks(self):