Skip to content

[pyOpenMS] Fix docutils errors in nanobind docstrings (#9460) - #9629

Merged
timosachsenberg merged 1 commit into
developfrom
fix/pyopenms-docstring-rst-errors
Jun 19, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
fix/pyopenms-docstring-rst-errors

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Fixes the 6 docutils ERRORs the pyOpenMS readthedocs/Sphinx build emits from nanobind binding docstrings. The build still succeeded (these are non-fatal), but the errors pollute the log and break cross-references in the rendered API docs.

Root cause

Two distinct RST-parsing issues:

  1. Trailing-underscore member names leak into docstrings. OpenMS' C++ private-member convention (data_, fit_data_, transformations_, lambda_) appears verbatim in docstrings, where RST reads a word ending in _ at a word boundary as a hyperlink reference → ERROR: Unknown target name: "...". Affected: KDTreeFeatureNode.getIndex, MapAlignmentAlgorithmKD.addRTFitData, MapAlignmentAlgorithmKD.fitLOWESS, Pi0Result.
  2. FeatureFinderMetaboIdentCompound — the Constructor:/Arguments: blocks parse as block quotes, so the deeper-indented continuation line trips ERROR: Unexpected indentation.

Fix

  • Wrap the member-name references in double-backtick inline literals (``data_``), so RST treats them as code and renders them monospace.
  • Convert the Constructor:/Arguments: blocks to literal blocks (::) so the indented text is taken verbatim.

No behavioral change — docstrings only.

Verification

Clean Sphinx rebuild against the freshly-built bindings:

before after
docutils ERRORs 6 0
build succeeded succeeded

Remaining warnings are unrelated (missing intersphinx_mapping, hoverxref glossary noise) and out of scope here.

Part of #9460 (pyOpenMS readthedocs build task).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Enhanced Python API documentation formatting for consistency across binding modules. Updated docstring formatting for analysis, data structure, and feature finder classes to improve readability and standardization.

The Sphinx readthedocs build emitted 6 docutils ERRORs from binding
docstrings:

- OpenMS' trailing-underscore C++ member names (data_, fit_data_,
  transformations_, lambda_) leaked into docstrings, where RST reads a
  word ending in "_" at a word boundary as a hyperlink reference
  ("Unknown target name"). Wrapped these in double-backtick inline
  literals so RST treats them as code.
- FeatureFinderMetaboIdentCompound's "Constructor:"/"Arguments:" blocks
  parsed as block quotes, so the deeper-indented continuation line
  tripped "Unexpected indentation". Converted them to literal blocks
  (::) so the indented text is taken verbatim.

Verified: clean Sphinx rebuild now reports 0 docutils errors (was 6);
remaining warnings are unrelated (intersphinx/hoverxref config). Part
of #9460 (pyOpenMS readthedocs build).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@timosachsenberg timosachsenberg mentioned this pull request Jun 19, 2026
@timosachsenberg
timosachsenberg merged commit 147205a into develop Jun 19, 2026
44 checks passed
@timosachsenberg
timosachsenberg deleted the fix/pyopenms-docstring-rst-errors branch June 19, 2026 09:21
timosachsenberg added a commit that referenced this pull request Jun 22, 2026
- ProSE (#9633, #9644): fix entry for protein-level FDR now applied for
  single-file runs; was previously silently skipped unless -out_merged was
  used in multi-file mode
- pyOpenMS (#9629): fix entry for 6 docutils ERROR-level warnings in
  nanobind binding docstrings resolved


Claude-Session: https://claude.ai/code/session_01XUrYEuLbeCJznCzV51iJjk

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant