Skip to content

Commit 370915e

Browse files
igerberclaude
andcommitted
Address PR #366 CI review round 2 (2 P3): align ROADMAP wording with corrected scope; cover new exports in import-surface test
P3 #1 (ROADMAP wording drift): ROADMAP.md still said the new fields "gate WooldridgeDiD QMLE / ContinuousDiD prerequisites pre-fit" and mentioned "time-invariance", which contradicted the round-1 corrections to TreatmentDoseShape's docstring + autonomous guide §2 + §5.2. Reworded to match: the new fields add descriptive distributional context only; `outcome_shape.is_count_like` informs (not gates) the WooldridgeDiD QMLE judgment, and the authoritative ContinuousDiD pre-fit gates remain `has_never_treated`, `treatment_varies_within_unit`, and `is_balanced`. "Time-invariance" wording removed (the field was dropped in round 1). P3 #2 (import-surface test coverage): `test_top_level_import_surface()` previously only verified `profile_panel`, `PanelProfile`, `Alert`. Extended to also cover the two new public exports `OutcomeShape` and `TreatmentDoseShape`, asserting both their importability and their presence in `diff_diff.__all__`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cc91a7d commit 370915e

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Long-running program, framed as "building toward" rather than with discrete ship
138138
- Baker et al. (2025) 8-step workflow enforcement in `diff_diff/practitioner.py`.
139139
- `practitioner_next_steps()` context-aware guidance.
140140
- Runtime LLM guides via `get_llm_guide(...)` (`llms.txt`, `llms-full.txt`, `llms-practitioner.txt`, `llms-autonomous.txt`), bundled in the wheel.
141-
- `profile_panel(df, ...)` returns a `PanelProfile` dataclass of structural facts about the panel - factual, not opinionated. Pairs with the `"autonomous"` guide variant (reference-shaped: estimator-support matrix + per-design-feature reasoning) so agents describe the data then consult a bundled reference rather than calling a deterministic recommender. `PanelProfile.outcome_shape` and `PanelProfile.treatment_dose` extensions expose count-likeness, bounded-support, dose support, and time-invariance facts that gate WooldridgeDiD QMLE / ContinuousDiD prerequisites pre-fit. The autonomous guide §5 walks through three end-to-end PanelProfile -> reasoning -> validation worked examples.
141+
- `profile_panel(df, ...)` returns a `PanelProfile` dataclass of structural facts about the panel - factual, not opinionated. Pairs with the `"autonomous"` guide variant (reference-shaped: estimator-support matrix + per-design-feature reasoning) so agents describe the data then consult a bundled reference rather than calling a deterministic recommender. `PanelProfile.outcome_shape` and `PanelProfile.treatment_dose` extensions add descriptive distributional context (count-likeness / bounded-support hints on numeric outcomes; dose support and zero-dose presence on continuous treatments). They are descriptive only — `outcome_shape.is_count_like` informs the WooldridgeDiD-QMLE-vs-linear-OLS judgment but does not gate it, and the authoritative ContinuousDiD pre-fit gates remain the existing `has_never_treated`, `treatment_varies_within_unit`, and `is_balanced` fields. The autonomous guide §5 walks through three end-to-end PanelProfile -> reasoning -> validation worked examples.
142142
- Package docstring leads with an "For AI agents" entry block so `help(diff_diff)` surfaces the agent entry points automatically.
143143
- Silent-operation warnings so agents and humans see the same signals at the same time.
144144

tests/test_profile_panel.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,23 @@ def test_all_nan_treatment_is_categorical():
402402

403403

404404
def test_top_level_import_surface():
405-
"""profile_panel, PanelProfile, and Alert must be importable from the
406-
top-level namespace so `help(diff_diff)` points at real symbols."""
405+
"""profile_panel, PanelProfile, Alert, OutcomeShape, and
406+
TreatmentDoseShape must be importable from the top-level namespace
407+
so `help(diff_diff)` points at real symbols."""
407408
import diff_diff
408409

409410
assert callable(diff_diff.profile_panel)
410411
assert diff_diff.PanelProfile.__name__ == "PanelProfile"
411412
assert diff_diff.Alert.__name__ == "Alert"
412-
for name in ("profile_panel", "PanelProfile", "Alert"):
413+
assert diff_diff.OutcomeShape.__name__ == "OutcomeShape"
414+
assert diff_diff.TreatmentDoseShape.__name__ == "TreatmentDoseShape"
415+
for name in (
416+
"profile_panel",
417+
"PanelProfile",
418+
"Alert",
419+
"OutcomeShape",
420+
"TreatmentDoseShape",
421+
):
413422
assert name in diff_diff.__all__, f"{name} missing from __all__"
414423

415424

0 commit comments

Comments
 (0)