Refactor: tech debt paydown - module split, warning fixes, deprecation updates#95
Conversation
…n updates - Split prep.py into prep.py (core utilities) and prep_dgp.py (data generation) - Update deprecation warning for bootstrap_weight_type to v3.0 - Add np.errstate wrappers to suppress RuntimeWarnings in staggered modules - Fix Rust Clippy warnings (type complexity, too_many_args, needless range loop) - Update README and tutorial to use bootstrap_weights parameter - Update TODO.md and CLAUDE.md documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Overall assessment: Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Open Questions
Executive Summary
|
…ions Address PR #95 feedback: add explicit np.isfinite checks after matmul operations to detect and warn on non-finite SEs/CIs from edge cases (small samples, extreme weights). Changes: - staggered_aggregation.py: Check wif_contrib after aggregation matmul - staggered_bootstrap.py: Add _check_and_fix_nonfinite helper method - staggered_bootstrap.py: Check results after 4 bootstrap matmul operations - test_staggered.py: Add test_extreme_weights_warning regression test Co-Authored-By: Claude Opus 4.5 <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
|
Address PR #95 reviewer feedback: - Analytic SE: return NaN instead of zeroing to signal invalid inference - Bootstrap: drop invalid samples and warn, preserving valid distribution - Update test to verify methodology-aligned behavior (finite or NaN, not biased) Per docs/methodology/REGISTRY.md: "Missing group-time cells: ATT(g,t) set to NaN" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Open Questions
Overall assessment: Executive Summary
|
…licy - Fix bootstrap p-value floor to use valid sample count (not n_bootstrap) - Remove unused _mask_nonfinite_samples method (dead code) - Document non-finite inference handling in Methodology Registry - Fix misleading test docstring that claimed undocumented behavior Co-Authored-By: Claude Opus 4.5 <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
|
… tests - Refactor _compute_bootstrap_pvalue to accept n_valid parameter, eliminating duplicated p-value logic in _compute_effect_bootstrap_stats - Extend np.errstate coverage in staggered_aggregation.py to wrap all WIF division operations (not just matrix multiplication) - Add deviation note to Methodology Registry documenting defensive enhancement over R/Stata reference implementations - Strengthen test assertions: verify warnings are captured and NaN SE is accompanied by validity warnings - Add test_validity_threshold_nan_se for edge case coverage Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Open Questions
Overall Assessment
Executive Summary
|
Integrate Methodology Registry into development workflow: - Add docs/methodology/REGISTRY.md to documentation section - Add new "Implementing Methodology-Critical Code" checklist - Strengthen "Adding Warning/Error/Fallback Handling" checklist - Update bug fix requirements to include methodology updates These changes ensure PR #95 issues are prevented by requiring: - Consultation of REGISTRY.md before methodology changes - Documentation of deviations from reference implementations - Behavioral tests that assert warnings AND outcomes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
prep.py(1,993 lines) intoprep.py(1,241 lines) andprep_dgp.py(777 lines) for better maintainabilitybootstrap_weight_typefrom "v2.0" to "v3.0"np.errstatecontext managers instaggered_aggregation.pyandstaggered_bootstrap.pyto suppress RuntimeWarnings during weight influence function computationbootstrap_weightsinstead of deprecatedbootstrap_weight_typeMethodology references (required if estimator / math changes)
Validation
cargo clippyreports 0 warningsSecurity / privacy
Generated with Claude Code