Commit f34ef8f
committed
Handle empty variant_query results gracefully instead of raising ValueError
When variant_query filters leave zero SNPs in snp_allele_frequencies_advanced() and
aa_allele_frequencies_advanced(), the code previously raised ValueError. This is
a pre-existing fragility exposed by the region slicing fix (is not None checks
can yield more accurate but smaller variant sets).
Changed both sites to emit a UserWarning and continue, returning an empty but
well-formed xr.Dataset with stable schema. This follows the existing precedent
in aa_allele_frequencies() (line 354) which already handles empty results
gracefully.1 parent c594023 commit f34ef8f
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
675 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
676 | 678 | | |
677 | 679 | | |
678 | 680 | | |
| |||
813 | 815 | | |
814 | 816 | | |
815 | 817 | | |
816 | | - | |
817 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
818 | 822 | | |
819 | 823 | | |
820 | 824 | | |
| |||
0 commit comments