Repository navigation
Conversation
Every name changed here was introduced after 4.0.0. - DesignDiagnosisResults.results -> power_results (and the to_dict() key). `results` also names the fitted model on DesignReconciliationResults, which keeps it; the new name sits beside mde_results and event_study_results. - The reconciliation check status "not checked" -> "not_checked", the spelling of every other status value and of the report block's own keys. - design.placebo_pretest_rate and design.PLACEBO_ESTIMAND are private (neither was exported). - HonestDiD.power_by_M: `power` is the share of draws whose interval excludes zero on either side, the definition of the rejection rates diagnose_design reports (it counted the effect's side only). `mde` is unchanged and its guarantee still holds. The table gains the `size_controlled` column it computed and dropped. - HonestDiD.fit and its siblings raise the power_by_M pointer for a design diagnosis too, not a generic "Unsupported results type". - DMLDiDResults.get_loo_effects_df says it is not available for DMLDiD; the inherited message told the user to refit with CallawaySantAnna.
Overall assessment: ✅ Looks goodNo unmitigated P0, P1, or P2 findings identified. Executive summary
MethodologyAffected method:
Empty and nonfinite interval handling remains intact; failed size checks retain NaN power and MDE values. No estimator, weighting, or variance changes were introduced. Code QualityNo findings. Renamed helpers and diagnosis fields have no stale callers in the searched source, tests, or benchmarks. PerformanceNo findings. The additional rejection condition introduces negligible work relative to the existing interval calculations. MaintainabilityNo findings. The shared extraction guard consistently routes diagnosis inputs toward planning, and the DML accessor now gives an applicable error. Tech DebtNo new untracked limitation identified. Existing planning restrictions are documented or tracked. SecurityNo findings in the supplied diff. Documentation/TestsNo actionable findings. Documentation, examples, tests, and a changelog fragment were updated. All 14 changed Python files and the tutorial’s code cells parsed successfully. Targeted pytest execution stopped before collection because pytest is unavailable; NumPy, pandas, and SciPy are also absent. Runtime behavior and backend parity therefore remain unverified in this environment. |
Summary
A consistency pass over the design-stage API added since 4.0.0, before it is released. Nothing here changes behaviour of anything in 4.0.0: every name below was introduced after that release.
Renames and values:
DesignDiagnosisResults.resultsis nowpower_results, and the matching key ofto_dict()likewise.resultsmeant two things in the same module: the per-estimator power cells on the diagnosis, and the fitted model onDesignReconciliationResults(which keepsresults). The new name sits besidemde_resultsandevent_study_results."not checked"is now"not_checked". Every other status value in the library is snake_case, and the report block already spells its own keysnot_checked/n_not_checked. The summary text is unchanged.design.placebo_pretest_rateanddesign.PLACEBO_ESTIMANDare now private (_placebo_pretest_rate,_PLACEBO_ESTIMAND). Neither was exported; every sibling helper already had an underscore.HonestDiD.power_by_M:poweris now the share of draws whose interval excludes zero, on either side: the rule ofHonestDiDResults.is_significantand of the rejection ratesdiagnose_designreports, so "power" has one meaning across the diagnosis. It previously counted only intervals on the effect's side of zero.mdeis unchanged (it is set from the effect's side alone, the larger of the two signs), and its guarantee still holds: an interval on the effect's side excludes zero, sopoweris at least that share and the target is reached for every effect larger thanmde. The two definitions differ by at mostplacebo_rejection_rate; tutorial 34's numbers are unchanged.size_controlledcolumn. It was computed per row and then dropped, so a withheld row was recognisable only by its NaN. The diagnosis table already has that column.Error messages:
HonestDiD.fit(diagnosis)(andsensitivity_analysis,breakdown_value,compute_honest_did) raised a generic "Unsupported results type". It now raises the sameValueErroras for a placebo event study, pointing topower_by_M.DMLDiDResults.get_loo_effects_df()is inherited fromCallawaySantAnnaResultsand can never succeed (DMLDiDhas novcov_type); its error told the user to refit withCallawaySantAnna. It now says the method is not available forDMLDiDresults.Reviewed and left as it is:
DesignLock.fitreturning the reconciliation with the estimate in.results;event_study=ondiagnose_design;placebo_rejection_ratein both planning tables;design_reconciliation=on the reports.Methodology references (required if estimator / math changes)
docs/methodology/REGISTRY.md## HonestDiD,Note (design-stage planning, power_by_M): thepower(th)line of the definition block and the paragraph onpowerandmdeare rewritten for the two-sided definition, andsize_controlledis added to the block.power_by_Mis a library procedure with no paper source (Rambachan & Roth 2023 give no planning procedure); the Note says so.powermoves to the one the rest of the diagnosis uses.Validation
tests/test_design_sensitivity.py(two-sided power against real injection on every identity case;powercounts an exclusion on either side;mdeis set from the effect's side only and the target holds above it for both signs; thesize_controlledcolumn;fit(diagnosis)andsensitivity_analysis(diagnosis)namepower_by_M),tests/test_staggered_jackknife.py(theDMLDiDaccessor error; the refusal itself was already tested),tests/test_diagnostic_marker.py(the shared reconciliation fixture uses the status vocabulary, and the summary and report block count its skipped check),tests/test_design.py,tests/test_methodology_design.py,tests/test_design_event_study.py,tests/test_t34_design_diagnosis_drift.py,tests/helpers/results_foundation.py(renames and the status value).result.power_results) and every output is identical.benchmarks/data/sensitivity_planning_check.jsonis unchanged: it checks the plannedmde, whose definition did not change.mypy diff_diffat the pinned versions reports no errors; the Sphinx-Wbuild passes.Security / privacy
Changelog
20261126-sensitivity-planning.mdis updated so the release notes describepowerandsize_controlledas shipped.