Skip to content

Commit 86ca61c

Browse files
igerberclaude
andcommitted
Address PR #376 R5 P3 (docstring drift)
R5 P3: HAD.fit() docstring still described `survey` and `weights` as "keyword-only" (they're positional-or-keyword after the R4 P1 fix that restored back-compat) and the `cband` paragraph only mentioned the old `survey=` / `weights=` kwargs (omitted the canonical `survey_design=`). Runtime behavior was correct; just generated help text drift. - Drop "keyword-only" qualifier from `survey` / `weights` parameter lines in the docstring; add note that they remain positional-or-keyword for one minor cycle for back-compat. - Update `cband` paragraph to cover all three of `survey_design=` / `survey=` / `weights=` (was: only the deprecated two). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent af998df commit 86ca61c

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

diff_diff/had.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,12 +2861,15 @@ def fit(
28612861
Replicate-weight designs raise ``NotImplementedError``
28622862
(Phase 4.5 C). Mutually exclusive with the deprecated
28632863
``survey=`` and ``weights=`` aliases.
2864-
survey : SurveyDesign or None, keyword-only
2865-
DEPRECATED alias of ``survey_design=``. Will be removed in
2866-
the next minor release; prefer ``survey_design=``.
2867-
weights : np.ndarray or None, keyword-only
2868-
DEPRECATED alias for the per-row pweight shortcut. Prefer
2869-
adding the weights as a column on ``data`` and passing
2864+
survey : SurveyDesign or None
2865+
DEPRECATED alias of ``survey_design=``. Remains positional-or-
2866+
keyword for one minor cycle to preserve pre-PR call shapes;
2867+
will be removed in the next minor release. Prefer
2868+
``survey_design=``.
2869+
weights : np.ndarray or None
2870+
DEPRECATED alias for the per-row pweight shortcut. Remains
2871+
positional-or-keyword for one minor cycle. Prefer adding the
2872+
weights as a column on ``data`` and passing
28702873
``survey_design=SurveyDesign(weights='col_name')`` instead.
28712874
Will be removed in the next minor release. Currently
28722875
preserved as the analytical-HC1-sandwich shortcut (continuous:
@@ -2876,14 +2879,14 @@ def fit(
28762879
cband : bool, default True
28772880
Phase 4.5 B: controls the multiplier-bootstrap simultaneous
28782881
confidence band on the weighted event-study path. When
2879-
``True`` (default) and ``aggregate="event_study"`` AND
2880-
``weights=`` or ``survey=`` is supplied, the fit populates
2881-
``cband_low`` / ``cband_high`` / ``cband_crit_value`` /
2882-
``cband_method`` / ``cband_n_bootstrap`` on the result. When
2883-
``False`` those fields stay ``None``. No effect on
2884-
``aggregate="overall"`` or on unweighted event-study.
2885-
``n_bootstrap`` and ``seed`` (constructor params) control
2886-
replicate count and RNG; defaults are 999 / ``None``.
2882+
``True`` (default) and ``aggregate="event_study"`` AND any of
2883+
``survey_design=`` / ``survey=`` / ``weights=`` is supplied,
2884+
the fit populates ``cband_low`` / ``cband_high`` /
2885+
``cband_crit_value`` / ``cband_method`` / ``cband_n_bootstrap``
2886+
on the result. When ``False`` those fields stay ``None``. No
2887+
effect on ``aggregate="overall"`` or on unweighted event-
2888+
study. ``n_bootstrap`` and ``seed`` (constructor params)
2889+
control replicate count and RNG; defaults are 999 / ``None``.
28872890
28882891
Returns
28892892
-------

0 commit comments

Comments
 (0)