Add UserWarning emissions for 8 silent operations#256
Conversation
Add warnings for: lstsq→pinv fallback, NaN y_tilde masking, always-treated survey weight note, consolidated (g,t) cell skip, missing treatment fill, Rust→Python fallback (4 sites), weight normalization, and inf→0 never-treated conversion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
P1-1: Materialize NaN entries for skipped (g,t) cells in vectorized and covariate regression paths (REGISTRY contract line 350). P1-2: Reject observed treatment=NaN before pivoting in TROP to distinguish bad input from structural panel gaps. P2-1: Consolidated skip warning now reports NaN cell reasons. P2-2: Extract _validate_and_pivot_treatment shared helper to trop_local.py, eliminating duplication between trop.py and trop_global.py. P2-3/P2-4: Add regression tests for treatment=NaN rejection and NaN-materialization of skipped cells. P3-1: Update return type annotations to Tuple[Dict, Dict, Dict]. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
- Revert NaN materialization for skipped (g,t) cells (broke
test_non_consecutive_time_periods and test_some_units_treated_first_period)
- Fix inf/int64 TypeError on pandas >=2.0 in test_item8 (cast to float)
- Extract _mask_nan_ytilde helper in TwoStageDiD for consistent y_tilde
warning across static, event_study, and group Stage 2 paths
- Remove redundant _aggregate_simple NaN warning (upstream warnings suffice)
- Fix test string mismatch ("cell(s) skipped" → "could not be estimated")
- Add event_study/group aggregation warning tests for TwoStageDiD
- Add TODO.md entry for NaN materialization as future tech debt
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
Update REGISTRY.md to document actual behavior: non-estimable (g,t) cells are omitted from group_time_effects (not NaN-materialized). NaN materialization tracked as future work in TODO.md. Strengthen skip-warning test: unconditional assertion, deterministic test data with both succeeding and failing cohorts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Static review only. I could not run the tests in this sandbox because Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
Extend consolidated skip warning to all CS estimation paths (general DR/IPW and repeated cross-section), not just vectorized/covariate reg. Update REGISTRY.md with labeled **Note:** documenting omission behavior per reviewer rubric requirements. Fix misleading comment in _aggregate_simple about upstream warnings. Add DR-path and panel=False skip warning tests. Filter expected skip warnings in power tests that use not_yet_treated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment Static review only. I could not run the tests in this sandbox because Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
Make survey zero-effective-mass branches consistent with skip contract: - _compute_att_gt_fast: return None (not np.nan) for zero-mass cells - vectorized survey path: track zero-mass skips in skipped_empty_cell - _compute_att_gt_rc: return None (not np.nan) for zero-mass cells All three now feed into the consolidated skip warning. Update TODO.md to describe actual remaining work (downstream consumer updates for optional NaN materialization) instead of contradicting the REGISTRY.md omission contract. Add survey-weighted zero-mass skip warning test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment✅ Looks good Static review only. I could not run the test suite in this environment because Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Version bump covering silent warning audit (#256), replicate weight expansion (#253), and imputation pre-period coefficients (#252). Adds Phase 8 survey maturity roadmap (SDR, FPC expansion, lonely PSU, CV, weight trimming, compatibility matrix). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
UserWarningemissions for 8 previously silent operations across 5 estimators so users know what changed, why, and what to do differentlytreatment=NaNbefore TROP pivot, extract shared treatment validation helper, update return type annotationsMethodology references (required if estimator / math changes)
Validation
tests/test_staggered.py,tests/test_two_stage.py,tests/test_trop.py,tests/test_survey.py(21 new tests total: positive/negative warning assertions, NaN materialization, treatment=NaN rejection)Security / privacy
Generated with Claude Code