Skip to content

Add short aliases for all estimators#188

Merged
igerber merged 2 commits intomainfrom
estimator-aliases
Mar 8, 2026
Merged

Add short aliases for all estimators#188
igerber merged 2 commits intomainfrom
estimator-aliases

Conversation

@igerber
Copy link
Copy Markdown
Owner

@igerber igerber commented Mar 7, 2026

Summary

  • Add 12 convenience aliases (DiD, TWFE, EventStudy, SDiD, CS, CDiD, SA, BJS, Gardner, DDD, Stacked, Bacon) for verbose estimator class names
  • Add aliases to __all__ for discoverability
  • Add tests verifying alias identity, __all__ membership, and instantiation
  • Document aliases in API reference and quickstart guide

Methodology references (required if estimator / math changes)

  • N/A — no methodology changes, only name aliases in __init__.py

Validation

  • Tests added: tests/test_aliases.py (3 tests: identity, __all__, instantiation)
  • All tests pass: pytest tests/test_aliases.py -v

Security / privacy

  • Confirm no secrets/PII in this PR: Yes

Generated with Claude Code

Introduce 12 convenience aliases (DiD, TWFE, EventStudy, SDiD, CS, CDiD,
SA, BJS, Gardner, DDD, Stacked, Bacon) so users can write concise imports
like `from diff_diff import DiD, TWFE, CS`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

Overall assessment: ⚠️ Needs changes

Executive Summary

  • Alias exports/tests/docs are the only changes; no estimator math/SE/assumption logic is touched.
  • Registry cross-check shows a doc/coverage mismatch: TROP is an estimator in the registry but is not covered by the “all estimators” alias claim.
  • No other code quality, performance, or security issues observed in this diff.

Methodology

  • P2 — Impact: Docs state “short aliases are available for all estimators,” but the Methodology Registry lists TROP as an estimator and there is no short alias defined/exported for it; this makes the claim inaccurate and can mislead users who expect a missing alias. Concrete fix: either add a short alias for TROP (and include it in alias tests), or reword the docs to “selected estimators” and note that TROP already uses its short canonical name. References: docs/api/estimators.rst:20, diff_diff/__init__.py:162, diff_diff/__init__.py:189, docs/methodology/REGISTRY.md:1019, tests/test_aliases.py:24.

Code Quality
No findings.

Performance
No findings.

Maintainability
No findings.

Tech Debt
No findings.

Security
No findings.

Documentation/Tests
No additional findings. Tests not run in this review.

TROP already uses its short canonical name, so "all estimators have
aliases" was inaccurate. Update docs/api/estimators.rst and
docs/quickstart.rst to say "most estimators" instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@igerber
Copy link
Copy Markdown
Owner Author

igerber commented Mar 8, 2026

/ai-review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2026

🔁 AI review rerun (requested by @igerber)

Head SHA: 36f2d7530b46f23476875a90a310b1bcf6ee085b


Overall assessment: ✅ Looks good

Executive Summary

  • Alias-only changes in diff_diff/__init__.py:162 do not touch estimator logic, weighting, inference, or defaults; Methodology Registry adherence is unchanged.
  • Added tests cover alias identity and __all__ membership, with a basic instantiation check. tests/test_aliases.py:1
  • Minor documentation categorization issue: Bacon Decomposition is a diagnostic in the Methodology Registry but is presented as an estimator alias in docs/comments, which can mislead users. docs/api/estimators.rst:20, diff_diff/__init__.py:162, docs/methodology/REGISTRY.md:22

Methodology

  • No findings. Alias definitions only; no estimator math or assumptions changed. diff_diff/__init__.py:162

Code Quality

  • No findings.

Performance

  • No findings.

Maintainability

  • No findings.

Tech Debt

  • No findings.

Security

  • No findings.

Documentation/Tests

  • Severity: P3. Impact: Bacon Decomposition is categorized under Diagnostics & Sensitivity in the Methodology Registry but is described alongside estimator aliases, which can cause user confusion about its role. Fix: adjust wording to “estimators and diagnostics” or move Bacon to a diagnostics alias list; optionally update the “Estimator aliases” comment. docs/api/estimators.rst:20, diff_diff/__init__.py:162, docs/methodology/REGISTRY.md:22
  • No findings. Tests not run in this review.

@igerber igerber merged commit 290b13a into main Mar 8, 2026
10 checks passed
@igerber igerber deleted the estimator-aliases branch March 8, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant