Commit a66b9ad
twfe: scope coefficients-dict broadening to HC2/HC2-BM only
CI review (R7) flagged a P2 scope creep in the R1 coefficients-dict
fix: I built `_twfe_var_names` on BOTH the full-dummy and within-
transform branches, which silently broadened
`result.coefficients` on HC1/classical/Conley paths from
`{"ATT": att}` to `{"const": c, "ATT": att, ...covariates}`. That's
a user-visible API change on unchanged TWFE paths that wasn't
documented in CHANGELOG/REGISTRY or regression-tested.
Per the reviewer's recommendation, restoring the historical
`{"ATT": att}` contract on within-transform paths by setting
`_twfe_var_names = None` on the else branch (the fallback at the
DiDResults construction site handles None via the existing
`{"ATT": float(att)}` literal). Only the HC2/HC2-BM full-dummy path
now broadens the dict — which is what the REGISTRY/CHANGELOG
surface-change disclosure documents, and what the alignment-invariant
test and full-surface regression test pin.
Verified end-to-end: hc1/classical → `{'ATT'}`; hc2/hc2_bm →
`{'const', 'ATT', '_fe_unit_*', '_fe_time_*'}`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 25c364f commit a66b9ad
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
365 | 369 | | |
366 | 370 | | |
367 | 371 | | |
| |||
0 commit comments