Commit 2ed01b0
docs: fix 86 Sphinx ERRORs across docstring substitutions and indentation
PR 1 of a 2-PR Sphinx cleanup sequence. Drops baseline ERROR count from
86 to 0 in `make html` output, unblocking eventual `-W` enforcement in
docs-tests.yml. WARNING count drops collaterally from 2,199 to 2,170
(systemic duplicate-object-description class deferred to PR 2).
Class A - Undefined substitution references (~50 instances).
RST treats `|X|` as a substitution-reference; on `|ATT|`, `|overall ATT|`,
`|DID_M|`, `|h|`, `|Omega_0|`, `|delta_{...}|`, etc. with no defined
substitution, the build errors. Per-context fix:
- coef_var docstrings across results.py, *_results.py: `SE / |ATT|`
-> `SE / abs(ATT)` (plain English, readable in `help()`).
- imputation.py / two_stage.py horizon parameter: `|h|` -> `abs(h)`.
- imputation_results.py matrix-cardinality: `|Omega_1|` ->
`:math:\`|\Omega_1|\``.
- honest_did.py Delta-class smoothness/relative-magnitude restrictions:
inline `|delta_{t+1} - delta_t|` math -> `.. math::` block (DeltaSD,
DeltaRM) or inline `:math:` (DeltaSDRM list items), with `\delta`
LaTeX rendering.
- trop.py / trop_results.py / docs/api/trop.rst: `|s-t|` and `|t-s|` ->
`:math:\`|s-t|\``.
Class B - Unexpected indentation in numpydoc bullet lists.
RST requires a blank line between a colon-terminated description line
and the bullet list that follows. Affected sites use the same pattern:
parameter `X : type` description ending with `:`, then bullets without
blank line. Fix is a single inserted blank line per site, applied to:
- bacon.py:bacon_decompose (weights param + Returns block)
- staggered.py:CallawaySantAnna (rank_deficient_action, base_period,
pscore_fallback)
- triple_diff.py:TripleDifference (estimation_method,
rank_deficient_action, pscore_fallback)
- twfe.py:TwoWayFixedEffects.decompose (weights param)
- synthetic_did.py:SyntheticDiD (use-cases bullet list,
variance_method)
- prep.py:rank_control_units (Returns columns)
- had.py:HeterogeneousAdoptionDiDResults (se attribute bullets)
- results.py:SyntheticDiDResults.get_loo_effects_df (Available on,
Blocked on, Returns columns)
Other fixes:
- diagnostic_report.py:DiagnosticReport - collapsed multi-line
parameter name list (`run_parallel_trends, run_sensitivity, ...`) to
single line so RST recognizes the parameter group; replaced em-dash
with hyphen per repo convention.
- docs/api/local_linear.rst:48 - replaced `.. autodata:: KERNELS`
(which Sphinx tries to construct a docstring for via autodoc, hitting
RST parse errors on the surrounding source comments) with manual
`.. py:data::` directive carrying the same content.
Out of scope (queued):
- 2,170 systemic `duplicate object description` warnings from
page-level autoclass `:members:` overlapping with autosummary stubs
(PR 2: most likely add `:no-index:` to ~25-30 page-level directives
per Sphinx's recommended fix).
- Adding `-W` to `docs-tests.yml` (PR 3, after PR 2).
Verification:
- `make html`: 0 ERRORs (was 86), 2,170 WARNINGs (was 2,199).
- `pytest tests/test_doc_snippets.py`: 111 passed, 4 skipped (unchanged
baseline).
- 0 em-dashes in diff.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent df270ab commit 2ed01b0
25 files changed
Lines changed: 63 additions & 39 deletions
File tree
- diff_diff
- docs/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
| 1088 | + | |
1088 | 1089 | | |
1089 | 1090 | | |
1090 | 1091 | | |
| |||
1094 | 1095 | | |
1095 | 1096 | | |
1096 | 1097 | | |
| 1098 | + | |
1097 | 1099 | | |
1098 | 1100 | | |
1099 | 1101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
704 | | - | |
| 704 | + | |
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
| 259 | + | |
261 | 260 | | |
262 | | - | |
| 261 | + | |
263 | 262 | | |
264 | 263 | | |
265 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | | - | |
113 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
834 | 834 | | |
835 | 835 | | |
836 | 836 | | |
| 837 | + | |
837 | 838 | | |
838 | 839 | | |
839 | 840 | | |
| |||
846 | 847 | | |
847 | 848 | | |
848 | 849 | | |
| 850 | + | |
849 | 851 | | |
850 | 852 | | |
851 | 853 | | |
| |||
0 commit comments