Skip to content

Commit e6127c2

Browse files
committed
fix: raise ValueError when all cohorts filtered out in _setup_cohort_queries
Signed-off-by: Suhrid Marwah <suhridmarwah07@gmail.com>
1 parent 3014709 commit e6127c2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

malariagen_data/anoph/sample_metadata.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,12 @@ def _setup_cohort_queries(
15401540
else:
15411541
cohort_queries_checked[cohort_label] = cohort_query
15421542

1543+
if not cohort_queries_checked:
1544+
raise ValueError(
1545+
"No cohorts remain after applying the minimum cohort size filter. "
1546+
"Try reducing `min_cohort_size` or broadening your sample selection."
1547+
)
1548+
15431549
return cohort_queries_checked
15441550

15451551
@_check_types

0 commit comments

Comments
 (0)