Skip to content

Commit 0500909

Browse files
igerberclaude
andcommitted
Fix Sphinx -W docstring failure on SyntheticDiD
CI's Sphinx HTML build (-W warnings as errors) failed on f3d5d92 with: diff_diff/synthetic_did.py:docstring of diff_diff.synthetic_did.SyntheticDiD:63: WARNING: Field list ends without a blank line; unexpected unindent. [docutils] The Conley-rejection block I added in 8ab51c4 used a custom section header "Notes (Conley spatial-HAC rejection)" with a parenthetical suffix. NumPy- style docstring parsers only recognize the bare section names (Notes, Parameters, etc.); the parenthetical version confused the field-list parser which then unindented the prior Parameters list incorrectly. Move the Conley-rejection paragraph into the canonical Notes section that already existed lower in the docstring, prefixed with a bold "**Conley spatial-HAC rejection.**" lead-in so the content remains visually distinguished. No content lost. Verified clean locally with `python -m sphinx -W -q -b html docs /tmp/sphinx-html` (exit 0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f3d5d92 commit 0500909

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

diff_diff/synthetic_did.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,6 @@ class SyntheticDiD(DifferenceInDifferences):
8686
Random seed for reproducibility. If None (default), results
8787
will vary between runs.
8888
89-
Notes (Conley spatial-HAC rejection)
90-
------------------------------------
91-
SyntheticDiD does not support the Conley (1999) spatial-HAC analytical
92-
sandwich. Passing ``vcov_type="conley"`` or any non-``None`` Conley
93-
keyword (``conley_coords``, ``conley_cutoff_km``, ``conley_metric``,
94-
``conley_kernel``) to ``__init__`` or ``set_params`` raises
95-
``TypeError``. Rationale: SyntheticDiD's variance is derived from
96-
bootstrap / jackknife / placebo resampling (Arkhangelsky et al. 2021
97-
Algorithms 2–4), not the sandwich identity Conley plugs into. Adding
98-
Conley support would require either an analytical SDID sandwich path
99-
or a spatial-block bootstrap (Politis-Romano 1994 territory). Tracked
100-
as a follow-up in ``TODO.md``.
101-
10289
Attributes
10390
----------
10491
results_ : SyntheticDiDResults
@@ -159,6 +146,18 @@ class SyntheticDiD(DifferenceInDifferences):
159146
- Standard DiD (uniform weights): ω_j = 1/N_control
160147
- Synthetic Control (exact matching): concentrated weights
161148
149+
**Conley spatial-HAC rejection.** SyntheticDiD does not support the
150+
Conley (1999) spatial-HAC analytical sandwich. Passing
151+
``vcov_type="conley"`` or any non-``None`` Conley keyword
152+
(``conley_coords``, ``conley_cutoff_km``, ``conley_metric``,
153+
``conley_kernel``) to ``__init__`` or ``set_params`` raises
154+
``TypeError``. Rationale: SyntheticDiD's variance is derived from
155+
bootstrap / jackknife / placebo resampling (Arkhangelsky et al. 2021
156+
Algorithms 2–4), not the sandwich identity Conley plugs into. Adding
157+
Conley support would require either an analytical SDID sandwich path
158+
or a spatial-block bootstrap (Politis-Romano 1994 territory). Tracked
159+
as a follow-up in ``TODO.md``.
160+
162161
References
163162
----------
164163
Arkhangelsky, D., Athey, S., Hirshberg, D. A., Imbens, G. W., & Wager, S.

0 commit comments

Comments
 (0)