You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address Codex review: MPD+survey reject, NaN unit guard, MPD coords guard
- Conley + survey_design front-door reject on MultiPeriodDiD.fit() so
the user gets NotImplementedError instead of silent BRR/TSL SEs. The
previous bypass: MPD passed return_vcov=not _use_survey_vcov to
solve_ols, so the conley+weights guard inside _compute_robust_vcov_numpy
never fired, and compute_survey_vcov silently overwrote the vcov.
- solve_ols also gains a top-level Conley-only validator that catches
bypass cases for direct compute_robust_vcov callers. Scoped to Conley
only — hc2_bm + replicate-weight silently routing to BRR is a
long-standing intentional contract preserved by other tests.
- _validate_conley_kwargs now rejects NaN / pd.NA in conley_unit. The
prior code accepted them and np.unique + boolean mask silently dropped
those rows from the per-unit serial HAC sum.
- MultiPeriodDiD.fit() adds an explicit conley_coords / conley_cutoff_km
None-guard so missing kwargs raise ValueError instead of a raw
TypeError on `self.conley_coords[0]`.
- TwoWayFixedEffects class docstring updated from Phase 1
"Conley rejected" / "Phase 2 will add Driscoll-Kraay product kernel"
to the shipped block-decomposed contract.
- Regression tests in tests/test_conley_vcov.py:
* TestConleyValidatorHelpers: NaN-float and pd.NA-object unit cases
* TestConleyEstimatorIntegration: MPD + survey_design (pweight TSL and
stratified PSU) raises; MPD missing conley_coords raises ValueError.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments