Skip to content

docs: add :no-index: to page-level autoclass directives (PR 2 of 2)#407

Merged
igerber merged 1 commit intomainfrom
docs/sphinx-warning-cleanup
May 9, 2026
Merged

docs: add :no-index: to page-level autoclass directives (PR 2 of 2)#407
igerber merged 1 commit intomainfrom
docs/sphinx-warning-cleanup

Conversation

@igerber
Copy link
Copy Markdown
Owner

@igerber igerber commented May 9, 2026

Summary

PR 2 of the 2-PR Sphinx cleanup sequence (PR 1 = #405, landed
ec1de01). Drops make html warning count from 2,170 to 635
(71% reduction; 1,535 fewer warnings) by suppressing class-level
cross-reference duplicate registrations between page-level RST
files and autosummary stubs.

Sphinx itself recommends :no-index: for the duplicating side (per
the warning text). Architecture:

  • Page-level autoclass directives in docs/api/*.rst (78 sites
    across 23 files) get :no-index:
  • Autosummary stubs in docs/api/_autosummary/*.rst remain
    canonical for cross-references (:class:\DiDResults`` and
    similar resolve to stub pages)
  • Page-level pages still render member docs inline (no visual
    change to RST users); only the global cross-reference inventory
    is affected by :no-index:

Approach validated empirically before the global pass via spike
on bacon.rst (3 directives): all 19 baseline duplicates citing
api/bacon cleared (100% drop on the spike's local scope), 0
errors, all rendered HTML members preserved. Spike pass criteria
met; global pass applied via single sed invocation per file.

Methodology references

N/A - all changes are RST directive-option additions. No estimator
logic, defaults, weighting, or inference behavior changed.

Validation

  • make html: 0 errors, 635 warnings (was 2,170; baseline
    duplicate-object class dropped from 2,146 to 614). Critical
    point: no new warning categories introduced (5 apparent diffs
    vs PR 1 baseline are sort-uniq false positives — same counts in
    both builds).
  • pytest tests/test_doc_snippets.py: 111 passed, 4 skipped (Batch
    C / PR 1 baseline unchanged).
  • HTML rendering preserved: page-level pages still show member
    docs (281 <dt> tags in results.html); cross-refs resolve to
    stubs (DiDResults.att HTML id present in
    _autosummary/diff_diff.DiDResults.html, absent from
    api/results.html as :no-index: intends).
  • 0 em-dashes in diff.

Honest accounting on the residual 635 warnings

This PR achieves a 71% reduction, NOT the originally hoped-for ~99%.
The residual breakdown:

  • 614 duplicate object description warnings at the MEMBER
    level (e.g., BaconDecomposition.__init__ registered by both the
    stub's autoclass and the page-level autoclass's autodoc-injected
    :members: rendering). Sphinx's :no-index: on autoclass does
    NOT propagate to autodoc-generated member entries — only the
    class itself is suppressed. Resolving these requires either a
    custom autosummary template OR :no-members: on page-level
    autoclass (UX impact: page-level pages no longer show inline
    member docs). Deferred to a separate PR with a fresh
    architectural decision.
  • 21 non-duplicate residuals: 4 unknown document: '../methodology/REPORTING' cross-refs; 3 EDiDBootstrapResults
    cross-ref ambiguities; ~14 misc autosummary import failures and
    unindented-text warnings. Each needs individual triage before
    -W enforcement (PR 3) can land.

Out of scope (queued)

Follow-up Plan
Member-level duplicate suppression Either custom autosummary template that drops :members: from generated stubs, OR add :no-members: to page-level autoclass directives (and accept the UX shift to clicking into stubs for member details). Architectural choice worth its own plan + review. Resolves the remaining 614 duplicates.
PR 3: Add -W to docs-tests.yml build One-line workflow change. Requires the 614 + 21 residuals above to be resolved first.
Triage 4 unknown document: '../methodology/REPORTING' warnings business_report.rst:48,52 and diagnostic_report.rst:14,18 link to a doc that doesn't exist on this branch. Either fix the link or suppress. PR 3 prerequisite.
Triage 3 EDiDBootstrapResults cross-ref ambiguities Sphinx finds two registration sites for the same symbol. Likely a stub generation issue; needs targeted investigation. PR 3 prerequisite.

Security / privacy

  • Confirm no secrets/PII in this PR: Yes

Generated with Claude Code

PR 2 of the 2-PR Sphinx cleanup sequence. Drops `make html` warning
count from 2,170 to 635 (71% reduction; 1,535 fewer warnings) by
suppressing class-level cross-reference duplicate registrations
between page-level RST files and autosummary stubs.

Sphinx itself recommends `:no-index:` for the duplicating side per
the warning text. Architecture: page-level autoclass directives in
`docs/api/*.rst` (78 sites across 23 files) get `:no-index:`; the
autosummary stubs in `docs/api/_autosummary/*.rst` remain canonical
for cross-references (`:class:\`DiDResults\`` and similar resolve to
stub pages). Page-level pages still render member docs inline (no
visual change to RST users); only the global cross-reference
inventory is affected.

Approach validated empirically before the global pass via spike on
`bacon.rst` (3 directives): all 19 baseline duplicates citing
`api/bacon` cleared (100% drop on the spike's local scope), 0 errors,
all rendered HTML members preserved (114 `<dt>` tags, fit/get_params/
set_params methods all visible). Spike pass criteria met; global pass
applied via single `sed` invocation per file.

Per-file breakdown (78 directives total):
- had.rst, staggered.rst: 8 each
- honest_did.rst: 6
- power.rst: 5
- results.rst, chaisemartin_dhaultfoeuille.rst, estimators.rst,
  profile.rst: 4 each
- bacon.rst, continuous_did.rst, efficient_did.rst, imputation.rst,
  local_linear.rst, pretrends.rst, two_stage.rst: 3 each
- business_report.rst, diagnostic_report.rst, stacked_did.rst,
  triple_diff.rst, trop.rst, wooldridge_etwfe.rst: 2 each
- diagnostics.rst, utils.rst: 1 each

Residual after this PR: 635 warnings (down from 2,170). Of these:
- 614 `duplicate object description` warnings remain at the MEMBER
  level (e.g., `BaconDecomposition.__init__` registered by both the
  stub's autoclass and the page-level autoclass's autodoc-injected
  `:members:` rendering). Sphinx's `:no-index:` on autoclass does
  NOT propagate to autodoc-generated member entries, so members are
  re-registered despite the class itself being suppressed. Resolving
  these requires either a custom autosummary template OR adding
  `:no-members:` to page-level autoclass directives (UX impact:
  page-level no longer shows inline member docs). Deferred to a
  separate PR with a fresh architectural decision.
- 21 non-duplicate residuals (4 `unknown document:
  '../methodology/REPORTING'` cross-refs; 3 `EDiDBootstrapResults`
  cross-ref ambiguities; ~14 misc autosummary import failures and
  unindented-text warnings). Each needs individual triage before
  `-W` enforcement (PR 3) can land.

Verification:
- `make html`: 0 errors, 635 warnings (was 2,170; baseline duplicate-
  object class dropped from 2,146 to 614; no new warning categories).
- `pytest tests/test_doc_snippets.py`: 111 passed, 4 skipped (Batch C
  / PR 1 baseline unchanged).
- HTML rendering preserved: page-level pages still show member docs;
  cross-refs resolve to stubs (DiDResults.att HTML id present in
  `_autosummary/diff_diff.DiDResults.html`, absent from
  `api/results.html` as `:no-index:` intends).
- 0 em-dashes in diff.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Overall Assessment: ✅ Looks Good

Executive Summary

  • No estimator logic, defaults, weighting, variance, SE, or identification assumptions are changed.
  • Methodology registry cross-check found no affected causal methods; this is an RST indexing-only change.
  • Sibling-surface audit passed: top-level docs/api/*.rst autoclass blocks now have :no-index:, while _autosummary stubs remain indexed.
  • Pattern-wide inference grep found no new Python inference/NaN-guard surface in the PR.
  • Existing residual Sphinx warning debt is tracked in TODO.md, so it is informational only.

Methodology

Finding: None

  • Severity: P3 informational
  • Impact: No causal methodology surface is affected. The diff only adds :no-index: to page-level Sphinx autoclass directives, e.g. docs/api/estimators.rst:L33-L86, docs/api/staggered.rst:L21-L155, docs/api/results.rst:L13-L84.
  • Concrete fix: None required.

Code Quality

Finding: None

  • Severity: P3 informational
  • Impact: No Python code changed. No inline inference computation or NaN/Inf propagation changes were introduced.
  • Concrete fix: None required.

Performance

Finding: None

  • Severity: P3 informational
  • Impact: Documentation indexing changes only; no runtime performance impact.
  • Concrete fix: None required.

Maintainability

Finding: No unmirrored page-level autoclass surface found

  • Severity: P3 informational
  • Impact: The mirror audit found no remaining top-level docs/api/*.rst autoclass blocks missing :no-index:. Autosummary stubs such as docs/api/_autosummary/diff_diff.DiDResults.rst:L6 remain canonical/indexed.
  • Concrete fix: None required.

Tech Debt

Finding: Residual Sphinx warning cleanup remains tracked

  • Severity: P3 informational
  • Impact: The broader duplicate-object warning debt is already tracked in TODO.md:L134, with related autosummary/import/xref debt at TODO.md:L137-L139. Under the deferred-work policy, this is not a blocker for this PR.
  • Concrete fix: None required in this PR.

Security

Finding: None

  • Severity: P3 informational
  • Impact: RST directive-option changes do not introduce secrets, network calls, unsafe execution, or data exposure.
  • Concrete fix: None required.

Documentation/Tests

Finding: Static review only; build/test claims not independently rerun

  • Severity: P3 informational
  • Impact: The sandbox is read-only, so I did not rerun make html or pytest tests/test_doc_snippets.py. Static audits of the changed RST pattern passed.
  • Concrete fix: None required; CI/build logs should remain the source of truth for the warning count.

@igerber igerber added the ready-for-ci Triggers CI test workflows label May 9, 2026
@igerber igerber merged commit 6679455 into main May 9, 2026
7 of 8 checks passed
@igerber igerber deleted the docs/sphinx-warning-cleanup branch May 9, 2026 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ci Triggers CI test workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant