Skip to content

Conversation

@woodtp
Copy link

@woodtp woodtp commented Dec 16, 2025

Produce official documentation for PyORBIT. Automatically generates the Python API reference with sphinx.ext.autosummary. To enable automatic documentation for the C++ part of the repo, a combination of Doxygen, Breathe, and Exhale is used.

Important

New Dependencies:

sphinx
doxygen
breathe
exhale

Todo

  • Quick Start/Installation instructions/examples/other static content
  • Figure out why sphinx.ext.autosummary works intermittently between the various orbit modules.
  • Extend to C++ portion of code base.
  • Setup HTML deployment to somewhere... lab-hosted? GitHub Pages?
    • CI/CD
  • Decide on a theme
  • Ship dependenciesrequirements.txt required to build docs.
  • How to handle documentation of python bindings to C++?
  • There are many errors as sphinx attempts to parse existing docstrings. Should those be resolved as part of this PR? E.g.,
pyorbit3/py/orbit/time_dep/time_dep.py:docstring of orbit.time_dep.time_dep.TIME_DEP_Lattice:3: ERROR: Unexpected indentation. [docutils]
pyorbit3/py/orbit/time_dep/time_dep.py:docstring of orbit.time_dep.time_dep.TIME_DEP_Lattice:4: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils]

Glimpse of the current configuration:

image

@woodtp woodtp added the documentation Improvements or additions to documentation label Dec 16, 2025
@woodtp woodtp self-assigned this Dec 16, 2025
@woodtp woodtp requested a review from azukov December 16, 2025 01:55
@woodtp
Copy link
Author

woodtp commented Dec 16, 2025

I'm not a fan of how sphinx-apidoc appends each submodule of orbit with "... package" in the header. I think it would be cleaner if each item in the TOC was simply:

orbit.aperture
orbit.bunch_generators
...

I haven't yet determined whether details like these are customizable in the options or would it require manual intervention/an external script.

@woodtp
Copy link
Author

woodtp commented Dec 17, 2025

Relevant to #84, apparently compilation will fail if any of numpy, scipy, or matplotlib are missing as a consequence of:

from numpy import *
from scipy.optimize import fsolve
from scipy.optimize import root
from scipy.integrate import odeint
from scipy.constants import c
from matplotlib.pyplot import *

import numpy as np
from scipy.optimize import leastsq

#101 resolves this.

@woodtp
Copy link
Author

woodtp commented Dec 18, 2025

Automatic generation of docs for the C++ part of the repo is working with the inclusion of Breathe and Exhale. I'm excluding all of the wrapper code from being documented; we probably want to handle documentation of bindings in a more useful format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant