Commit b376043
Fix CI review R9: align controls aggregation to effective sample
R8's controls-block fix scoped NaN/Inf validation to the positive-weight
subset (shorter data_controls) but then assigned those shorter arrays
into an x_agg_input built from the full-length frame, causing a
length-mismatch on any SurveyDesign.subpopulation() / zero-weight
excluded row before covariate aggregation could run.
Root-caused fix: derive both the validation frame AND the aggregation
frame from the same positive-weight effective sample (data_eff,
survey_weights_eff). Zero-weight rows are genuinely out-of-sample
throughout the DID^X path now. Non-survey fits unchanged.
Added TestZeroWeightSubpopulation.test_zero_weight_row_with_nan_control
pinning the subpopulation contract for the DID^X path — injects a
zero-weight row with NaN control value and asserts fit() succeeds.
All 263 targeted tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent de8ff5e commit b376043
2 files changed
Lines changed: 37 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
738 | 737 | | |
739 | 738 | | |
740 | | - | |
| 739 | + | |
| 740 | + | |
741 | 741 | | |
742 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
743 | 745 | | |
744 | 746 | | |
745 | 747 | | |
| |||
760 | 762 | | |
761 | 763 | | |
762 | 764 | | |
763 | | - | |
764 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
765 | 768 | | |
766 | | - | |
| 769 | + | |
767 | 770 | | |
768 | | - | |
| 771 | + | |
769 | 772 | | |
770 | | - | |
| 773 | + | |
771 | 774 | | |
772 | 775 | | |
773 | 776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
864 | 886 | | |
865 | 887 | | |
866 | 888 | | |
| |||
0 commit comments