Skip to content

Commit 83329a2

Browse files
igerberclaude
andcommitted
Address PR #376 R6 P3 (Raises blocks doc drift)
R6 P3: Raises blocks on stute_test, yatchew_hr_test, and did_had_pretest_workflow still described the pre-PR 2-way `survey`/`weights` mutex. Updated to the 3-way `survey_design + survey + weights` form, with `survey=` / `weights=` flagged as deprecated aliases. Also added the TypeError raise to the array-in helpers' Raises blocks (stute_test, yatchew_hr_test) since they reject SurveyDesign instances on `survey_design=` (and equivalently on the deprecated `survey=` alias after R1's guard reorder). Runtime behavior was correct; just generated help text drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 86ca61c commit 83329a2

1 file changed

Lines changed: 25 additions & 7 deletions

File tree

diff_diff/had_pretests.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,8 +1506,16 @@ def stute_test(
15061506
If ``d`` / ``dy`` are not 1D numeric, contain NaN, have unequal
15071507
lengths, if any ``d`` value is negative (paper Section 2 HAD
15081508
support restriction), if ``alpha`` is outside ``(0, 1)``, or if
1509-
``n_bootstrap < 99``. Also raised if BOTH ``weights`` and
1510-
``survey`` are supplied (mutex).
1509+
``n_bootstrap < 99``. Also raised if more than one of
1510+
``survey_design``, ``survey``, ``weights`` is supplied (3-way
1511+
mutex; ``survey=`` and ``weights=`` are deprecated aliases of
1512+
``survey_design=``).
1513+
TypeError
1514+
If ``survey_design=SurveyDesign(...)`` (or the deprecated
1515+
``survey=SurveyDesign(...)`` alias) is passed; array-in helpers
1516+
accept ``ResolvedSurveyDesign`` only. Use
1517+
``survey_design=make_pweight_design(arr)`` for pweight-only or
1518+
pre-resolve via ``SurveyDesign(...).resolve(data)``.
15111519
NotImplementedError
15121520
If ``survey.replicate_weights is not None``. Replicate-weight
15131521
pretests are a parallel follow-up after Phase 4.5 C; the
@@ -1961,8 +1969,16 @@ def yatchew_hr_test(
19611969
If ``d`` / ``dy`` are not 1D numeric, contain NaN, have unequal
19621970
lengths, if any ``d`` value is negative (paper Section 2 HAD
19631971
support restriction), or if ``alpha`` is outside ``(0, 1)``.
1964-
Also raised if BOTH ``weights`` and ``survey`` supplied (mutex),
1965-
or if any weight is non-positive.
1972+
Also raised if more than one of ``survey_design``, ``survey``,
1973+
``weights`` is supplied (3-way mutex; ``survey=`` and
1974+
``weights=`` are deprecated aliases of ``survey_design=``), or
1975+
if any weight is non-positive.
1976+
TypeError
1977+
If ``survey_design=SurveyDesign(...)`` (or the deprecated
1978+
``survey=SurveyDesign(...)`` alias) is passed; array-in helpers
1979+
accept ``ResolvedSurveyDesign`` only. Use
1980+
``survey_design=make_pweight_design(arr)`` for pweight-only or
1981+
pre-resolve via ``SurveyDesign(...).resolve(data)``.
19661982
NotImplementedError
19671983
If ``survey.replicate_weights is not None`` (deferred follow-up).
19681984
@@ -4049,9 +4065,11 @@ def did_had_pretest_workflow(
40494065
Raises
40504066
------
40514067
ValueError
4052-
On invalid ``aggregate``, ``survey`` and ``weights`` both
4053-
non-None, or any downstream front-door failure (panel balance,
4054-
dtype, dose invariant).
4068+
On invalid ``aggregate``; if more than one of ``survey_design``,
4069+
``survey``, ``weights`` is supplied (3-way mutex; ``survey=`` and
4070+
``weights=`` are deprecated aliases of ``survey_design=``); or
4071+
any downstream front-door failure (panel balance, dtype, dose
4072+
invariant).
40554073
NotImplementedError
40564074
If ``survey.replicate_weights is not None`` (replicate-weight
40574075
pretests deferred to a parallel follow-up after Phase 4.5 C).

0 commit comments

Comments
 (0)