Commit b2f4dc4
fix: check realized never-treated count, not just fraction
Small never_treated_frac values (e.g., 0.01 with n_units=50) floor to
zero never-treated units via int(), silently breaking the conditional_pt
contract. Now checks int(n_units * never_treated_frac) >= 1 and reports
the realized count in the error message.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c86c0dc commit b2f4dc4
3 files changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1311 | 1311 | | |
1312 | 1312 | | |
1313 | 1313 | | |
1314 | | - | |
1315 | | - | |
| 1314 | + | |
| 1315 | + | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
| |||
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | | - | |
| 1440 | + | |
1441 | 1441 | | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
1446 | 1448 | | |
1447 | 1449 | | |
1448 | 1450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2708 | 2708 | | |
2709 | 2709 | | |
2710 | 2710 | | |
2711 | | - | |
2712 | | - | |
| 2711 | + | |
| 2712 | + | |
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1969 | 1969 | | |
1970 | 1970 | | |
1971 | 1971 | | |
1972 | | - | |
| 1972 | + | |
1973 | 1973 | | |
1974 | 1974 | | |
1975 | | - | |
| 1975 | + | |
| 1976 | + | |
1976 | 1977 | | |
1977 | 1978 | | |
1978 | 1979 | | |
1979 | 1980 | | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
1980 | 1987 | | |
1981 | 1988 | | |
1982 | 1989 | | |
| |||
0 commit comments