Commit e622d60
Address PR #346 CI review round 4: P1 d_lower > 0 on Design 1 paths
**P1 (Methodology): Design 1 paths must reject d_lower = 0**
Paper Section 3.2 partitions HAD by regime: `d_lower = 0` is Design 1'
(`continuous_at_zero`); `d_lower > 0` is Design 1 (`continuous_near_
d_lower` or `mass_point`). The auto-detect rule already respects this
partition, but explicit overrides previously allowed
`design="mass_point", d_lower=0` and `design="continuous_near_d_lower"`
on a `d.min()==0` sample to run silently, returning a
paper-incompatible estimand (2SLS with degenerate single-unit mass for
mass_point; Design 1' algebra relabeled as `WAS_d_lower` with a
spurious Assumption 5/6 warning for continuous_near_d_lower).
Fix: add a fit-time guard that raises `ValueError` when
`resolved_design in ("mass_point", "continuous_near_d_lower")` and the
resolved `d_lower_val` is within float tolerance of zero (same
tolerance family as `_detect_design`'s d.min()==0 tie-break). The
error message points users to `continuous_at_zero` or `auto` for
samples with support infimum at zero.
**Docstring + test updates:**
- Rewrote the `design` parameter docstring to document the
regime-partition contract precisely: each explicit override is
now described with its d_lower precondition and mass-point
compatibility.
- Rewrote the `d_lower` parameter docstring to note the
Design-1-requires-positive contract.
- Inverted the prior `test_force_mass_point_on_continuous_data_at_
support_infimum` test (which incorrectly codified the unsupported
behavior) into three rejection regressions:
`test_force_mass_point_on_d_lower_zero_sample_raises`,
`test_force_continuous_near_d_lower_on_d_lower_zero_sample_raises`,
`test_force_mass_point_d_lower_none_on_zero_sample_raises`.
Targeted regression: 135 HAD tests + 514 total across Phase 1 and
adjacent surfaces, all green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ddc09e4 commit e622d60
2 files changed
Lines changed: 75 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
835 | 854 | | |
836 | 855 | | |
837 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
838 | 861 | | |
839 | 862 | | |
840 | 863 | | |
| |||
1070 | 1093 | | |
1071 | 1094 | | |
1072 | 1095 | | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1073 | 1119 | | |
1074 | 1120 | | |
1075 | 1121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1108 | 1108 | | |
1109 | 1109 | | |
1110 | 1110 | | |
1111 | | - | |
1112 | | - | |
| 1111 | + | |
| 1112 | + | |
1113 | 1113 | | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1117 | 1118 | | |
1118 | 1119 | | |
1119 | 1120 | | |
1120 | | - | |
1121 | 1121 | | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
1125 | 1141 | | |
1126 | 1142 | | |
1127 | 1143 | | |
| |||
0 commit comments