Skip to content

Fix all Sphinx doc build warnings#66

Merged
lmoresi merged 3 commits intodevelopmentfrom
fix/sphinx-doc-warnings
Mar 3, 2026
Merged

Fix all Sphinx doc build warnings#66
lmoresi merged 3 commits intodevelopmentfrom
fix/sphinx-doc-warnings

Conversation

@lmoresi
Copy link
Member

@lmoresi lmoresi commented Mar 2, 2026

Summary

  • Remove duplicate-object warnings (44): Napoleon Attributes and Methods sections in 17 class docstrings created py:attribute entries that conflicted with autodoc's py:property entries from :members: processing. Removed the redundant Napoleon sections since autodoc documents all properties/methods automatically.
  • Exclude jupyter_execute/ artifacts (42): Stale myst_nb directory was generating image.not_readable and toc.not_included warnings. Added to exclude_patterns in conf.py.
  • Fix docstring RST indentation (3): Continuation lines in faults.py, surfaces.py, and units.py caused docutils "Unexpected indentation" errors.
  • Document PETSc-style CLI convention (closes Clarify difference between PETSc-style and argparse-style CLI options #46): Added "Why Single-Dash Options?" section to parameters.md explaining PETSc vs argparse conventions, with cross-reference from quickstart.md.

Clean build now produces 0 warnings (down from ~91).

Test plan

  • Verify sphinx-build -b html docs docs/_build/html completes with 0 warnings
  • Check API docs render correctly (properties/methods still documented via autodoc)
  • Review new "Why Single-Dash Options?" section in parameters guide

Underworld development team with AI support from Claude Code

Remove Napoleon Attributes/Methods sections from 17 class docstrings that
duplicated autodoc :members: output (44 duplicate-object warnings). Exclude
stale jupyter_execute/ artifacts from Sphinx (42 warnings). Fix RST
indentation in faults.py, surfaces.py, units.py docstrings (3 warnings).

Also document PETSc-style CLI convention in parameters.md (closes #46).

Underworld development team with AI support from Claude Code
Copilot AI review requested due to automatic review settings March 2, 2026 10:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets a clean Sphinx documentation build by eliminating doc build warnings and clarifying Underworld’s PETSc-style CLI option convention for users.

Changes:

  • Removed redundant Napoleon Attributes / Methods sections in multiple class docstrings to prevent duplicate-object warnings with autodoc :members:.
  • Excluded jupyter_execute/ artifacts from Sphinx input via exclude_patterns.
  • Improved/normalized several docstrings and beginner docs, including a new explanation of PETSc single-dash long options with a cross-reference from the quickstart.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/underworld3/units.py Docstring indentation/wording adjustment for get_units() argument docs.
src/underworld3/systems/solvers.py Removed Napoleon Attributes sections from solver class docstrings to avoid Sphinx duplicate-object warnings.
src/underworld3/systems/ddt.py Removed Napoleon Attributes sections from DDt class docstrings to avoid duplicate-object warnings.
src/underworld3/swarm.py Removed Napoleon Attributes / Methods sections from swarm-related docstrings to avoid duplicate-object warnings.
src/underworld3/meshing/surfaces.py Docstring indentation/wording adjustment to eliminate docutils indentation warnings.
src/underworld3/meshing/faults.py Docstring indentation/wording adjustment to eliminate docutils indentation warnings.
src/underworld3/discretisation/discretisation_mesh.py Removed Napoleon Attributes section from Mesh docstring to avoid duplicate-object warnings.
src/underworld3/coordinates.py Removed Napoleon Attributes sections from coordinate accessor/type docstrings to avoid duplicate-object warnings.
src/underworld3/constitutive_models.py Removed Napoleon Attributes sections from constitutive model docstrings to avoid duplicate-object warnings.
docs/conf.py Added jupyter_execute/** to Sphinx exclude_patterns.
docs/beginner/quickstart.md Added a cross-reference and brief inline clarification of PETSc-style single-dash options.
docs/beginner/parameters.md Added “Why Single-Dash Options?” section describing PETSc vs argparse conventions and guidance for wrappers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lmoresi added 2 commits March 3, 2026 07:44
…23)

add_particles_with_coordinates: document that non-local points are
filtered per-rank so passing a global array is safe (no duplicates).
add_particles_with_global_coordinates: document that every rank adds
all points before migration, note it is primarily for internal use,
and cross-reference the safer method.

Underworld development team with AI support from Claude Code
Soften claim about argparse incompatibility (it can be configured),
and use parse_known_args + remaining_argv in the tip example.

Underworld development team with AI support from Claude Code
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lmoresi
Copy link
Member Author

lmoresi commented Mar 3, 2026

Copilot requested fixes have been addressed.

Tests all passing.

This is mostly a docs bug-fix rather than any new features so I am going to merge this straight through.

@lmoresi lmoresi merged commit 1c84710 into development Mar 3, 2026
5 checks passed
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.

2 participants