Commit 98dcbb2
Address PR #356 CI review round 12 (1 P2 guide)
Balanced-panel eligibility gate tightened. `PanelProfile.is_balanced`
is computed from the unique `(unit, time)` support, so it stays `True`
even when duplicate rows exist — `duplicate_unit_time_rows` is a
separate alert for that case. But ContinuousDiD / EfficientDiD /
HeterogeneousAdoptionDiD all require exactly one observation per cell:
EfficientDiD and HAD raise ValueError on duplicates at fit() time, and
ContinuousDiD's precompute path silently resolves duplicates via
last-row-wins (which can change the estimand without warning).
Guide §3 balanced-panel-eligibility block now requires BOTH
`is_balanced == True` AND absence of the `duplicate_unit_time_rows`
alert before routing to these estimators, with the specific failure
mode (raise vs silent overwrite) named per-estimator and a concrete
two-step fix (`balance_panel()` + `drop_duplicates([unit, time])`).
Tests: extended the semantic guide test to assert the guide mentions
`duplicate_unit_time_rows` and uses "BOTH/both" wording around the
is_balanced gate, so future edits cannot silently drop the duplicate-
row half of the eligibility requirement.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3b7408a commit 98dcbb2
2 files changed
Lines changed: 33 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | | - | |
280 | | - | |
| 288 | + | |
| 289 | + | |
281 | 290 | | |
282 | 291 | | |
283 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
678 | 694 | | |
679 | 695 | | |
680 | 696 | | |
| |||
0 commit comments