Skip to content

Commit 0434408

Browse files
committed
R5: document survey zero-weight pre-filter in Raises text
CI AI review R4 P3: the Raises text reads as unconditional but survey-weighted fits drop zero-weight rows BEFORE running NaN / coercion / within-cell validation, per the SurveyDesign.subpopulation() out-of-sample contract (chaisemartin_dhaultfoeuille.py:170-178). NaN values in zero-weight rows therefore do not raise. Added a second paragraph to Raises describing this scope qualifier so the contract is complete.
1 parent 5d1e361 commit 0434408

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

diff_diff/chaisemartin_dhaultfoeuille.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ def _validate_and_aggregate_to_cells(
156156
``fit()`` time, not here at aggregation time — this helper
157157
accepts continuous ``d_gt`` cell means and lets ``fit()`` decide
158158
whether the integer-only contract applies.
159+
160+
Under the survey-weighted path (``weights`` is not ``None``),
161+
zero-weight rows are pre-filtered before any NaN / coercion /
162+
within-cell validation per the ``SurveyDesign.subpopulation()``
163+
out-of-sample contract — invalid values in zero-weight rows
164+
therefore do NOT raise. NaN / coercion / within-cell checks
165+
still apply to all positive-weight rows.
159166
"""
160167
# 1. Required columns
161168
missing = [c for c in (outcome, group, time, treatment) if c not in data.columns]

0 commit comments

Comments
 (0)