|
37 | 37 | import pandas as pd |
38 | 38 |
|
39 | 39 | from diff_diff._base import BaseEstimator |
40 | | -from diff_diff._deprecation import NOT_SUPPLIED, warn_deprecated_kwarg |
41 | 40 | from diff_diff.chaisemartin_dhaultfoeuille_bootstrap import ( |
42 | 41 | ChaisemartinDHaultfoeuilleBootstrapMixin, |
43 | 42 | ) |
@@ -401,8 +400,8 @@ class ChaisemartinDHaultfoeuille(ChaisemartinDHaultfoeuilleBootstrapMixin, BaseE |
401 | 400 | - TWFE decomposition diagnostic from Theorem 1 of AER 2020 |
402 | 401 |
|
403 | 402 | Aggregation is a post-fit step: ``results.aggregate('event_study')`` / |
404 | | - ``results.aggregate('simple')`` (the deprecated fit-time ``aggregate=`` |
405 | | - never computed anything and now warns; row M-026). |
| 403 | + ``results.aggregate('simple')``; ``fit()`` takes no aggregation |
| 404 | + keyword. |
406 | 405 |
|
407 | 406 | Parameters |
408 | 407 | ---------- |
@@ -878,7 +877,6 @@ def fit( |
878 | 877 | time: str, |
879 | 878 | treatment: str, |
880 | 879 | # ---------- forward-compat parameters ---------- |
881 | | - aggregate: Any = NOT_SUPPLIED, |
882 | 880 | L_max: Optional[int] = None, |
883 | 881 | covariates: Optional[List[str]] = None, |
884 | 882 | trends_linear: Optional[bool] = None, |
@@ -914,15 +912,6 @@ def fit( |
914 | 912 | within each ``(unit, time)`` cell. Both binary ``{0, 1}`` and |
915 | 913 | non-binary (ordinal or continuous) treatment are supported. |
916 | 914 | Non-binary treatment requires ``L_max >= 1``. |
917 | | - aggregate : str, optional |
918 | | - DEPRECATED since 3.9, removed in 4.0 (ledger row M-026). |
919 | | - Passing it emits a ``FutureWarning``. The parameter never |
920 | | - computed aggregations here (it was reserved and any non-None |
921 | | - value has always raised); aggregation is a POST-FIT step: |
922 | | - ``results.aggregate('event_study')`` for the multi-horizon |
923 | | - surface, ``results.aggregate('simple')`` for the overall |
924 | | - estimand. A non-None value now raises ``ValueError`` pointing |
925 | | - at that post-fit route. |
926 | 915 | L_max : int, optional |
927 | 916 | Maximum event-study horizon. When set, computes ``DID_l`` |
928 | 917 | for ``l = 1, ..., L_max`` using the per-group building block |
@@ -1063,28 +1052,8 @@ def fit( |
1063 | 1052 | # ------------------------------------------------------------------ |
1064 | 1053 | # Step 2: Forward-compat gates |
1065 | 1054 | # ------------------------------------------------------------------ |
1066 | | - # M-026: fit(aggregate=) is deprecated - the aggregation entry point |
1067 | | - # is post-fit (results.aggregate()). The param never computed |
1068 | | - # anything here (any non-None value has always raised), so the shim |
1069 | | - # warns on supply and rejects non-None values with a pointer at the |
1070 | | - # post-fit route. |
1071 | | - if aggregate is not NOT_SUPPLIED: |
1072 | | - warn_deprecated_kwarg( |
1073 | | - "ChaisemartinDHaultfoeuille.fit", |
1074 | | - "aggregate", |
1075 | | - "aggregation is a post-fit step: " |
1076 | | - "results.aggregate('event_study') / results.aggregate('simple')", |
1077 | | - ) |
1078 | | - if aggregate is not None: |
1079 | | - raise ValueError( |
1080 | | - f"fit(aggregate={aggregate!r}) never computed aggregations " |
1081 | | - "on ChaisemartinDHaultfoeuille (the parameter was reserved " |
1082 | | - "and always raised). Aggregate post-fit instead: " |
1083 | | - "results.aggregate('event_study') for the multi-horizon " |
1084 | | - "surface (Phase-1 fits without L_max return the 2-row " |
1085 | | - "l=1 view), or results.aggregate('simple') for the " |
1086 | | - "overall estimand." |
1087 | | - ) |
| 1055 | + # Aggregation is a post-fit step (results.aggregate('event_study') / |
| 1056 | + # results.aggregate('simple')); fit() takes no aggregation keyword. |
1088 | 1057 | _check_forward_compat_gates( |
1089 | 1058 | L_max=L_max, |
1090 | 1059 | controls=controls, |
@@ -4395,10 +4364,8 @@ def _check_forward_compat_gates( |
4395 | 4364 | """Raise ``NotImplementedError`` for any non-default Phase 3 parameter. |
4396 | 4365 |
|
4397 | 4366 | Phase 2 parameters (``L_max``) are validated inline in ``fit()`` |
4398 | | - after period detection. The deprecated ``aggregate`` parameter is |
4399 | | - resolved in ``fit()`` itself (row M-026: FutureWarning on supply, |
4400 | | - ValueError on any non-None value, pointing at the post-fit |
4401 | | - ``results.aggregate()`` route). |
| 4367 | + after period detection. Aggregation is a post-fit step |
| 4368 | + (``results.aggregate()``); ``fit()`` takes no aggregation keyword. |
4402 | 4369 | """ |
4403 | 4370 | # L_max is validated inline in fit() after period detection (needs |
4404 | 4371 | # the period count). Not gated here. |
|
0 commit comments