Commit ff7134d
Cover stratified-no-PSU branch in scaffolding equivalence tests
Addresses the P2 test-coverage gap from the CI review on PR #338:
_precompute_psu_scaffolding() has a dedicated strata-with-no-PSU
branch (survey.py:1458-1466) where each observation is its own PSU
within its stratum, but TestAggregateSurveyScaffolding did not
exercise it despite the docstring claiming every supported design
mode was covered.
Adds two parametrized cases to test_fast_path_equals_legacy:
- stratified_no_psu — SurveyDesign(weights=, strata=)
- stratified_no_psu_fpc — same plus stratum-level FPC lookup
(the fpc-on-this-branch path goes through the same per-stratum
first-obs FPC read as stratified+PSU, so both variants matter).
Both pass assert_allclose(atol=1e-14, rtol=1e-14) equivalence with
the legacy path across all cells.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6b7ba9f commit ff7134d
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3483 | 3483 | | |
3484 | 3484 | | |
3485 | 3485 | | |
| 3486 | + | |
| 3487 | + | |
| 3488 | + | |
| 3489 | + | |
| 3490 | + | |
| 3491 | + | |
| 3492 | + | |
| 3493 | + | |
| 3494 | + | |
| 3495 | + | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
3486 | 3504 | | |
3487 | 3505 | | |
3488 | 3506 | | |
| |||
3532 | 3550 | | |
3533 | 3551 | | |
3534 | 3552 | | |
| 3553 | + | |
| 3554 | + | |
3535 | 3555 | | |
3536 | 3556 | | |
3537 | 3557 | | |
| |||
0 commit comments