Commit f0aa060
stacked_did: address CI codex R1 P2 + P3 polish
CI codex R1 verdict was ✅ with 2 polish items:
P2 (Maintainability): StackedDiDResults.summary() didn't surface the
analytical variance family (vcov_type), even though hc1 vs hc2_bm are
now materially different user-facing inference modes. Other result
classes (DiD/MPD/TWFE) already print a Variance: line via the shared
`_format_vcov_label` helper at results.py:49-89. Fix: added a Variance:
line to StackedDiDResults.summary() using the shared helper, suppressed
under survey_metadata (the survey block already surfaces inference
source). My earlier plan note ("mirror SA: don't add Variance: row")
was based on a wrong assumption — SA-results uses the same shared
helper, and StackedDiD inherits the same precedent.
P3 (Performance): on `vcov_type="hc2_bm"` fits with `aggregate=None`
or `"simple"`, the code built per-event Bell-McCaffrey contrast DOFs
that were never surfaced (only overall ATT is exposed). Avoidable
CR2 cost on every overall-only hc2_bm fit. Fix: gated the per-event
contrast construction (es_keys, es_cols_full) on
`aggregate == "event_study"`. The overall ATT contrast still gets
computed unconditionally (it's the user-facing scalar).
89 tests still pass — no behavioral regression on the event-study
path; overall-only fits are now slightly faster.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent aedea7f commit f0aa060
2 files changed
Lines changed: 32 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
553 | 556 | | |
554 | 557 | | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
561 | 565 | | |
562 | 566 | | |
563 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
179 | 201 | | |
180 | 202 | | |
181 | 203 | | |
| |||
0 commit comments