Skip to content

Commit b237909

Browse files
authored
Merge pull request #39 from igerber/claude/refactor-estimators-n3DzQ
2 parents 2fe2f6b + ff2ae0f commit b237909

File tree

8 files changed

+961
-875
lines changed

8 files changed

+961
-875
lines changed

CLAUDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ mypy diff_diff
3737

3838
- **`diff_diff/estimators.py`** - Core estimator classes implementing DiD methods:
3939
- `DifferenceInDifferences` - Basic 2x2 DiD with formula or column-name interface
40-
- `TwoWayFixedEffects` - Panel DiD with unit and time fixed effects (within-transformation)
4140
- `MultiPeriodDiD` - Event-study style DiD with period-specific treatment effects
41+
- Re-exports `TwoWayFixedEffects` and `SyntheticDiD` for backward compatibility
42+
43+
- **`diff_diff/twfe.py`** - Two-Way Fixed Effects estimator:
44+
- `TwoWayFixedEffects` - Panel DiD with unit and time fixed effects (within-transformation)
45+
46+
- **`diff_diff/synthetic_did.py`** - Synthetic DiD estimator:
4247
- `SyntheticDiD` - Synthetic control combined with DiD (Arkhangelsky et al. 2021)
4348

4449
- **`diff_diff/staggered.py`** - Staggered adoption DiD estimators:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ Works with `DifferenceInDifferences` and `TwoWayFixedEffects` estimators.
539539
### Two-Way Fixed Effects (Panel Data)
540540

541541
```python
542-
from diff_diff.estimators import TwoWayFixedEffects
542+
from diff_diff import TwoWayFixedEffects
543543

544544
twfe = TwoWayFixedEffects()
545545
results = twfe.fit(

TODO.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,20 @@ Current line counts (target: < 1000 lines per module):
7878
| File | Lines | Status |
7979
|------|-------|--------|
8080
| `staggered.py` | 1822 | Consider splitting |
81-
| `estimators.py` | 1812 | Consider splitting |
81+
| `estimators.py` | ~975 | OK (refactored) |
82+
| `twfe.py` | ~355 | OK (new) |
83+
| `synthetic_did.py` | ~540 | OK (new) |
8284
| `honest_did.py` | 1491 | Acceptable |
8385
| `utils.py` | 1350 | Acceptable |
8486
| `power.py` | 1350 | Acceptable |
8587
| `prep.py` | 1338 | Acceptable |
8688
| `visualization.py` | 1388 | Acceptable |
8789
| `bacon.py` | 1027 | OK |
8890

91+
**Completed splits:**
92+
- ~~`estimators.py``twfe.py`, `synthetic_did.py` (keep base classes in estimators.py)~~ - Done in 1.0.2
93+
8994
**Potential splits:**
90-
- `estimators.py``twfe.py`, `synthetic_did.py` (keep base classes in estimators.py)
9195
- `staggered.py``staggered_bootstrap.py` (move bootstrap logic)
9296

9397
---

diff_diff/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
plot_sensitivity,
8686
)
8787

88-
__version__ = "1.0.0"
88+
__version__ = "1.0.2"
8989
__all__ = [
9090
# Estimators
9191
"DifferenceInDifferences",

0 commit comments

Comments
 (0)