Skip to content

Commit fb79a35

Browse files
committed
fix: raise ValueError when iHS/XP-EHH arrays are empty after filtering
Signed-off-by: Suhrid Marwah <suhridmarwah07@gmail.com>
1 parent e48d75b commit fb79a35

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

malariagen_data/anopheles.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,12 @@ def plot_ihs_gwss_track(
970970
inline_array=inline_array,
971971
)
972972

973+
if len(x) == 0:
974+
raise ValueError(
975+
"No iHS values remain after filtering. "
976+
"Try relaxing filter_min_maf or min_ehh parameters."
977+
)
978+
973979
# determine X axis range
974980
x_min = x[0]
975981
x_max = x[-1]
@@ -1494,6 +1500,12 @@ def plot_xpehh_gwss_track(
14941500
inline_array=inline_array,
14951501
)
14961502

1503+
if len(x) == 0:
1504+
raise ValueError(
1505+
"No XP-EHH values remain after filtering. "
1506+
"Try relaxing filter_min_maf or min_ehh parameters."
1507+
)
1508+
14971509
# determine X axis range
14981510
x_min = x[0]
14991511
x_max = x[-1]

0 commit comments

Comments
 (0)