From 75dd91ba45932cedb0f6a46529acde40fb480ac4 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Sat, 29 Feb 2020 19:22:04 +0100 Subject: [PATCH] Extended coverage --- barplots/barplots.py | 4 ++-- tests/test_wrong_parameters.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/barplots/barplots.py b/barplots/barplots.py index 2573e62..4724523 100644 --- a/barplots/barplots.py +++ b/barplots/barplots.py @@ -67,9 +67,9 @@ def barplots( "path":path.format(feature=feature).replace(" ", "_").lower(), **barplot_kwargs } for original, feature in zip(original, features) - if not pd.isna(groupby[original]).any().any() + if not pd.isna(groupby[original]).any().any() and not len(groupby[original]) == 0 ] - + if len(tasks) == 0: raise ValueError("No plottable feature found in given dataframe!") diff --git a/tests/test_wrong_parameters.py b/tests/test_wrong_parameters.py index 849ee9c..d46688d 100644 --- a/tests/test_wrong_parameters.py +++ b/tests/test_wrong_parameters.py @@ -11,7 +11,6 @@ def test_wrong_parameters(): barplots( df[df.cell_line == "CIAO"], ["cell_line", "task", "balancing", "model"], - orientation="pinco", path="{root}/{{feature}}.png".format(root=root) )