From e93d3b1e5479b35624d6acd716b7e06dc5725707 Mon Sep 17 00:00:00 2001 From: OlivierBeq <35777118+OlivierBeq@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:55:39 +0200 Subject: [PATCH] Fix keep_source --- src/papyrus_scripts/__init__.py | 2 +- src/papyrus_scripts/preprocess.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/papyrus_scripts/__init__.py b/src/papyrus_scripts/__init__.py index 15d6cae..52eb3d9 100644 --- a/src/papyrus_scripts/__init__.py +++ b/src/papyrus_scripts/__init__.py @@ -16,4 +16,4 @@ from .utils.mol_reader import MolSupplier from .utils import IO, UniprotMatch -__version__ = '1.0.2' +__version__ = '1.0.3' diff --git a/src/papyrus_scripts/preprocess.py b/src/papyrus_scripts/preprocess.py index 51d1fdb..5b92b34 100644 --- a/src/papyrus_scripts/preprocess.py +++ b/src/papyrus_scripts/preprocess.py @@ -159,7 +159,8 @@ def keep_source(data: Union[pd.DataFrame, PandasTextFileReader, Iterator], sourc return data # Source not defined elif set(source).difference(sources): - raise ValueError(f'Source not supported, must be one of {sources}') + # Supplied source not in data sources + return data[data.source == 'SOURCE UNAVAILABLE'] # Ensures an empty dataframe with colnames is returned # Sources are defined else: # Columns with optional multiple values