From 767a1127dac5c95c06c35149490cf20664caca01 Mon Sep 17 00:00:00 2001 From: sfluegel Date: Tue, 6 May 2025 18:05:49 +0200 Subject: [PATCH] fix order of operations during none filtering in data preprocessing --- chebai/preprocessing/datasets/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chebai/preprocessing/datasets/base.py b/chebai/preprocessing/datasets/base.py index 5cd210be..4cf6edf0 100644 --- a/chebai/preprocessing/datasets/base.py +++ b/chebai/preprocessing/datasets/base.py @@ -335,8 +335,9 @@ def _load_data_from_file(self, path: str) -> List[Dict[str, Any]]: val for val in data if val["features"] is not None - and self.n_token_limit is None - or len(val["features"]) <= self.n_token_limit + and ( + self.n_token_limit is None or len(val["features"]) <= self.n_token_limit + ) ] return data