Skip to content

docs: API reference cleanup - #39

Merged
petercorke merged 5 commits into
jhavl:mainfrom
petercorke:docs/api-reference-cleanup
Aug 9, 2026
Merged

docs: API reference cleanup#39
petercorke merged 5 commits into
jhavl:mainfrom
petercorke:docs/api-reference-cleanup

Conversation

@petercorke

Copy link
Copy Markdown
Collaborator

Summary

A broad pass over the Sphinx docs and a few examples, prompted by reviewing
the API reference end-to-end.

  • New fileformats.rst: which mesh file formats Swift (three.js) and
    trimesh/Coal each support, the 5-format overlap that works for both
    display and collision, per-format history/tradeoffs, and a summary table.

  • conf.py: autoclass_content = 'both' so each class's __init__
    docstring (pose/color/stype/base -- previously invisible on every
    subclass page, since Sphinx's default only shows the class docstring) now
    merges in; case-insensitive alphabetical member sort; "Inherited from X"
    labels on inherited members; a GitHub link in the footer.

  • api.rst: added Ellipsoid/CollisionShapeGroup to the inheritance
    diagram (was missing); excluded the deprecated collided() method from
    every CollisionShape subclass page, including CollisionShapeGroup
    (previously missed).

  • intro.rst: reworked throughout -- consistent from spatialgeometry import X style instead of mixed import ... as sg/as gm; fixed a
    launch()/pose mix-up (launch() doesn't exist in this package, that
    was a leftover reference to Swift's unrelated method), invalid matplotlib
    color names in a runnable example, and a broken table.T *= SE3(...)
    example (in-place multiply with an SE3 operand silently does elementwise
    math, not pose composition); documented the SceneGroup
    list-membership/scene_parent equivalence people can otherwise trip over.

    Depends on #38 --
    the scene-graph examples now call the new update() method, so those two
    runblocks won't build clean until that merges.

  • Docstrings (SceneNode/SceneGroup/CollisionShape/Shape):
    reordered to precis -> params -> expanded description throughout; added
    missing :param: entries (initlist on the two group classes); Mesh's
    color-override behavior moved from a redundant/conflicting :param: entry
    into a proper .. note::; removed duplicate pose entries that had
    drifted onto Axes/Arrow/Path.

  • examples/: consolidated animating_shapes.py/displaying_shapes.py/
    scene_graph.py into cube.py/mesh.py/room.py (one of the originals
    moved to Swift's own examples instead).

Test plan

petercorke and others added 5 commits August 7, 2026 12:01
…page

Add docstrings for Shape/Axes/Arrow/Path/CollisionShape/Box properties and
for the SceneNode, SceneGroup, Shape, and CollisionShape base classes,
none of which had any before. Fix a pre-existing wrong return type
annotation on SceneNode.scene_parent while in there.

Rework docs/source/api.rst: add a class inheritance diagram, a class
summary table for the four base classes (via autosummary :toctree:, so
each gets a real linkable page), and convert the leaf shape classes from
blanket automodule directives to explicit autoclass entries so their
:class: cross-references resolve to the public spatialgeometry.X path
instead of silently failing to link against the internal geom.* module
path. Add a custom autosummary/class.rst template so the generated base
class pages show full member docs instead of Sphinx's default thin
summary-only table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Brings in the full PR batch landed today (jhavl#19-jhavl#25, jhavl#27, jhavl#29-jhavl#32).
Three conflicts, all in code this branch's own doc-focused commits
had touched:

- CollisionShape.py: Mesh's filename/scale docstring -- this branch's
  copy predated jhavl#19/jhavl#22, took origin/main's newer/complete version
  (adds color, y_up params).
- SceneGroup.py: this branch's copy predated jhavl#21's list-wiring
  rewrite entirely (old **kwargs-only constructor) -- took
  origin/main's version wholesale.
- Shape.py: two independently-written class docstrings, not a
  stale/current split -- kept this branch's own prose since it's the
  one actively being authored here.

WIP (uncommitted doc edits) was stashed before this merge and not yet
reapplied.
…toclass fixes

- New fileformats.rst: mesh file format support matrix (Swift vs trimesh,
  the 5-format overlap, per-format history/tradeoffs, a summary table)
- conf.py: autoclass_content='both' so each class's __init__ docstring
  (pose/color/stype/base, previously invisible on every subclass page)
  merges with its class docstring; case-insensitive alphabetical member
  sort; "Inherited from X" labels on inherited members; GitHub link in
  footer (_templates/footer.html)
- api.rst: added Ellipsoid/CollisionShapeGroup to the inheritance diagram,
  excluded the deprecated collided() method from every CollisionShape
  subclass page including CollisionShapeGroup
- intro.rst: substantially reworked -- consistent `from spatialgeometry
  import X` style instead of `import ... as sg/gm`, fixed several stale/
  incorrect passages (a launch()/pose mix-up, invalid matplotlib color
  names, a broken table.T *= SE3(...) example), documented the
  SceneGroup list-membership/scene_parent equivalence
  Depends on jhavl#38 (adds the update() method the
  scene-graph examples now call) -- these runblocks won't build clean
  until that merges.
- SceneNode/SceneGroup/CollisionShape/Shape docstrings: reordered to
  precis -> params -> expanded description throughout; added missing
  :param: entries (initlist on the two group classes); Mesh's color
  override moved from a redundant :param: into a proper .. note::;
  removed duplicate pose entries on Axes/Arrow/Path
- examples/: consolidated animating_shapes.py/displaying_shapes.py/
  scene_graph.py into cube.py/mesh.py/room.py
@petercorke
petercorke merged commit 550adeb into jhavl:main Aug 9, 2026
15 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.

1 participant