Commit f30c121
Address PR #356 CI review round 9 (1 P1 + 1 P2 semantic)
Rebased onto current main (resolved CHANGELOG.md conflict: the by_path
bullet from PR #355 and the profile_panel/autonomous-guide bullet from
this PR now live side-by-side under [Unreleased]).
has_always_treated now has binary-only semantics:
- For binary treatment (absorbing or non-absorbing): unit_min == 1
means the unit is treated in every observed period (no
pre-treatment information in the DiD sense).
- For continuous treatment: always False. Pre-treatment periods on
continuous DiD are determined by the separate `first_treat` column
supplied to `ContinuousDiD.fit`, not by whether the dose is
positive. A unit with a constant positive dose can still have
well-defined pre-treatment periods, so flagging it as
"always-treated / no pre-treatment information" was factually wrong
and triggered the misleading `has_always_treated_units` alert on
valid continuous panels.
- Categorical: False by construction.
Guide §2 has_always_treated field doc updated to state the
binary-only semantics explicitly, with a note about `first_treat`.
Tests:
- New: test_continuous_positive_dose_does_not_fire_has_always_treated
asserts has_always_treated=False AND the alert does not fire on a
constant-positive-dose continuous panel.
- Existing test_continuous_zero_dose_controls_flag_has_never_treated
updated: has_always_treated expected to be False (was True under
the old semantics).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6a1372b commit f30c121
3 files changed
Lines changed: 53 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
363 | | - | |
364 | 364 | | |
365 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
366 | 375 | | |
367 | 376 | | |
368 | 377 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
132 | 158 | | |
133 | 159 | | |
134 | 160 | | |
| |||
386 | 412 | | |
387 | 413 | | |
388 | 414 | | |
389 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
390 | 418 | | |
391 | 419 | | |
392 | 420 | | |
| |||
397 | 425 | | |
398 | 426 | | |
399 | 427 | | |
400 | | - | |
| 428 | + | |
401 | 429 | | |
402 | 430 | | |
403 | 431 | | |
| |||
0 commit comments