Commit 600111e
committed
fix: resolve NumPy 2.x boolean ambiguity in isel slicing paths
Convert boolean mask indexing to integer indices in xarray .isel() calls
to fix NumPy 2.x ValueError in frequency analysis functions.
Changes:
- snp_frq.py: snp_allele_frequencies_advanced (line 633)
- snp_frq.py: aa_allele_frequencies_advanced (line 771)
- cnv_frq.py: gene_cnv_frequencies_advanced (lines 638, 644)
Pattern applied: Replace ds.isel(variants=bool_mask) with:
variant_indices = np.where(bool_mask)[0]
ds.isel(variants=variant_indices)
Fixes 885 test failures in test_allele_frequencies_advanced* tests.
Maintains identical behavior with NumPy 1.26.x while achieving NumPy 2.x compatibility.1 parent 55f4f3b commit 600111e
2 files changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
638 | | - | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
639 | 641 | | |
640 | 642 | | |
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
644 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
645 | 649 | | |
646 | 650 | | |
647 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | | - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
634 | 636 | | |
635 | 637 | | |
636 | 638 | | |
| |||
768 | 770 | | |
769 | 771 | | |
770 | 772 | | |
771 | | - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
772 | 776 | | |
773 | 777 | | |
774 | 778 | | |
| |||
0 commit comments