Add WooldridgeDiD opt-out for comparison-support filtering - #820
Conversation
Overall assessment✅ Looks good — no unmitigated P0 or P1 findings. Executive summary
MethodologyP3-informational — Documented library policy
No weighting, aggregation, variance, SE, or inference methodology changes were found. Code QualityP2 — “Input validation runs first” is not fully implemented
PerformanceNo findings. The default path adds only trivial validation and metadata assignment. MaintainabilityNo findings. Parameter propagation through Tech DebtNo untracked debt found. The completed TODO entry is removed and M-147 records the new policy. SecurityNo findings or apparent secrets. Documentation/TestsP2 — Tutorial outputs retain the old summary format
The changelog fragment follows the repository convention. Independent test execution was unavailable because |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good — no unmitigated P0 or P1 findings. Executive summary
MethodologyP3 — Documented library policy
No weighting, variance, SE, identification-predicate, or inference changes were introduced. Code QualityNo findings. Constructor validation, transactional PerformanceNo findings. The new branch adds only constant-cost validation and metadata assignment. MaintainabilityNo findings. The parameter reaches Tech DebtNo untracked debt. The completed opt-out backlog row was removed and ledger entry M-147 records the policy. SecurityNo findings or apparent secrets. Documentation/TestsNo findings.
|
f7afa23 to
4c4a178
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good — no unmitigated P0 or P1 findings. Executive summary
MethodologyP3 — Documented library policy
No variance, SE, inference, weighting, or support-predicate changes were introduced. Code QualityNo findings. Validation is eager, transactional through PerformanceNo findings. The opt-out adds only validation and a linear observation-count calculation on the refusal path. MaintainabilityNo findings. The parameter reaches constructor introspection, all estimator methods, result provenance, aggregation, and legacy-pickle migration. Tech DebtNo untracked debt. The completed TODO item was removed and policy row M-147 records the behavior. SecurityNo findings or apparent secrets. Documentation/TestsNo findings.
|
WooldridgeDiD users can now set
unsupported_period_action="error"to refuse a fit when periods lack eligible comparison observations. The error identifies the unsupported periods and affected observation count before filtering or interaction construction. The default"drop"preserves existing filtering, warnings, and estimates.The option applies to OLS, logit, and Poisson independently of
rank_deficient_action. Constructor, transactionalset_params(), and fit-time checks validate the policy. Results record the fit-time policy in summaries and dictionaries and retain it through aggregation and serialization.Existing pre-filter configuration, cohort, and survey-design checks retain precedence. Later covariate, nonlinear-outcome, and some explicit-cluster errors can be preceded by support refusal. Keeping that order preserves successful default fits when invalid nonlinear outcomes occur only in discarded periods; regression tests cover this case. For valid survey designs requiring period removal,
"drop"retains the existingNotImplementedError, while"error"raises the policyValueError.Methodology references
control_group="never_treated"; other paths also admit observations beforeg - anticipation. Unidentified-cohort exclusion remains separate and active. Weighting, variance, inference, and default numerical behavior are unchanged.Validation
16_wooldridge_etwfe.ipynbwith nbmake: 1 passed. Its five stored ETWFE summaries now show the default policy; numerical and image outputs are unchanged.git diff --checkpassed. The pre-merge scanner found zero patterns; its results-module test-resolution warning is covered by explicit Wooldridge and serialization tests.Type-checking limitation: configured
mypy diff_difftargets Python 3.10 and stops in installed NumPy 2.5.2 stubs, which use Python 3.12 type statements. A minimalmypy -c 'import numpy'reproduced the failure. Supplementalmypy --python-version 3.14 diff_diffpassed for 108 source files; it does not replace the configured check. The local environment uses Python 3.14 and mypy 2.3.1; the lint workflow instead pins NumPy 2.4.5.The full library suite and full Sphinx build were not run. R/Stata parity tests used committed reference artifacts; external R/Stata executables were not invoked.
Security / privacy
Changelog
changelog.d/20260905-wooldridge-unsupported-period-action.md, referencing ledger row M-147.