From 71de05c4c6153384cc455eed02bd0d54004915c3 Mon Sep 17 00:00:00 2001 From: Yang Chen <60239063+yangchen2@users.noreply.github.com> Date: Fri, 19 Jan 2024 13:56:42 -0800 Subject: [PATCH] f-string format for discriminatory features warning, log number of discrim feats --- qadabra/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qadabra/utils.py b/qadabra/utils.py index 7c13096..56dd0f5 100644 --- a/qadabra/utils.py +++ b/qadabra/utils.py @@ -55,8 +55,8 @@ def _validate_input( discriminating_feats = feat_presence[~feat_presence].index.tolist() if len(discriminating_feats) > 0: - warning_msg = "Some features in the table perfectly discriminate factor groups:\n" + '\n'.join(discriminating_feats) + ".\nAutomatically filtering out these features before running Qadabra..." - print("Number of discriminating features: " + str(len(discriminating_feats))) + logger.warn("Number of discriminating features: " + str(len(discriminating_feats))) + warning_msg = f"Some features in the table perfectly discriminate factor groups. Automatically filtering out {len(discriminating_feats)} features before running Qadabra..." warnings.warn(warning_msg, category=Warning) # Filtering out the discriminating features from the BIOM table