Skip to content

Commit

Permalink
Print a warning for the fktables that do not exist during combination
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 committed Oct 10, 2023
1 parent 5313744 commit cc66bb4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/pineko/fonll.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import copy
import json
import logging
import tempfile
from pathlib import Path

Expand All @@ -12,6 +13,8 @@

from . import configs

logger = logging.getLogger(__name__)


class FONLLInfo:
"""Class containing all the information for FONLL predictions."""
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit cc66bb4

Please sign in to comment.