Sphinx documentation#226
Conversation
Add sphinx, furo, and sphinx-design as an optional 'docs' extra so the
documentation dependencies are declared alongside the project:
uv sync --extra docs
Co-authored-by: GitHub Copilot <copilot@github.com>
- conf.py: configure furo theme, autodoc, napoleon (Google style), and sphinx-design; extension load order ensures galsim_docstring runs before napoleon so the injected Parameters block is handled correctly - Makefile: 'make html' and 'make clean' targets using 'uv run' - requirements.txt: standalone pip-installable docs deps - _ext/galsim_docstring.py: autodoc-process-docstring hook that splits docstrings produced by the @implements decorator. It: * extracts the GalSim Parameters block and re-injects it in Google style so napoleon renders it as an explicit parameter table * wraps the remaining original GalSim narrative in a sphinx-design dropdown so it is collapsible in the HTML output - _static/custom.css: visual tweaks for the dropdown and parameter lists Co-authored-by: GitHub Copilot <copilot@github.com>
- index.rst: landing page with a grid linking to the API reference and the upstream GalSim docs - api/index.rst: top-level API table of contents - api/gsobjects.rst: GSObject base class and all analytic profiles (Gaussian, Moffat, Exponential, Spergel, Box, Pixel, DeltaFunction, Sum, Convolution, Deconvolution, Transform, Shear) - api/image.rst: Image variants, Bounds, and Position classes - api/noise.rst: random deviates, noise models, PhotonArray, Sensor - api/wcs.rst: WCS classes, CelestialCoord, Angle, FitsHeader - api/interpolation.rst: interpolant classes and InterpolatedImage - api/core.rst: internal utility modules (utils, math, integrate, interpolate, draw) Co-authored-by: GitHub Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com> Co-authored-by: GitHub Copilot <copilot@github.com>
…iption which is usually very important Co-authored-by: Copilot <copilot@github.com> Co-authored-by: GitHub Copilot <copilot@github.com>
Co-authored-by: GitHub Copilot <copilot@github.com>
…differences, api-coverage) - installation.rst: pip/GPU/dev install instructions, test and lint commands - quickstart.rst: complete simulation walkthrough with jit, grad, and vmap examples - notable-differences.rst: covers immutability, array views, PRNG, PyTrees, tracing restrictions, profile limitations, numerical precision, and @implements - api-coverage.rst: current 22.5% coverage summary with collapsible full API list --trailer "Co-authored-by: GitHub Copilot <copilot@github.com>"
- index.rst: merged content from mkdown/index.md — added CI/Ruff/pre-commit badges, early-dev warning admonition, Why JAX-GalSim feature grid, quick install block, minimal JIT+grad example, and expanded navigation card grid; toctree now includes the four new guide pages - core.rst: split into labelled sections (Math, Drawing, Utilities) and moved core.utils to the bottom so implementation details appear after higher-level modules --trailer "Co-authored-by: GitHub Copilot <copilot@github.com>"
Merging this PR will improve performance by ×2
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | test_benchmark_spergel_calcfluxrad[run] |
215.4 µs | 137.9 µs | +56.25% |
| ⚡ | WallTime | test_benchmarks_lanczos_interp[xval-no_conserve_dc-run] |
115.9 µs | 68.9 µs | +68.32% |
| ⚡ | WallTime | test_benchmarks_lanczos_interp[xval-conserve_dc-run] |
132.4 µs | 65.8 µs | ×2 |
| ⚡ | WallTime | test_benchmark_invert_ab_noraise[run] |
143.8 µs | 79.3 µs | +81.28% |
| ⚡ | WallTime | test_benchmarks_lanczos_interp[kval-conserve_dc-run] |
55.1 µs | 30.6 µs | +79.83% |
| ⚡ | WallTime | test_benchmarks_lanczos_interp[kval-no_conserve_dc-run] |
50.9 µs | 30.7 µs | +65.7% |
| ⚡ | WallTime | test_benchmark_interpimage_flux_frac[run] |
431.6 µs | 252.5 µs | +70.95% |
| ⚡ | WallTime | test_benchmark_spergel_kvalue[run] |
11.5 ms | 8.7 ms | +32.93% |
| ⚡ | WallTime | test_benchmark_moffat_init[run] |
94.8 µs | 46.7 µs | ×2 |
Comparing sphinx-docs (60ec3fa) with main (f04b831)
|
Can we add a build on readthedocs or github pages or something so that we can preview changes? |
|
I requested RTD for this repo. |
|
ah yes I can do that, although I was planning on using github pages. Perhaps we can discuss if RTD is better during the meeting? (it requires some additional setup i believe) |
|
actually RTD could be nice so we can preview the PR, github only allows one page per repo if I understand correctly. let me try to configure that... |
Co-authored-by: GitHub Copilot <copilot@github.com>
|
@beckermr it's available now! you just need to click on the RTD build below |
Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Copilot <copilot@github.com>
beckermr
left a comment
There was a problem hiding this comment.
I left some general comments. Overall, this looks great!
|
We should also add a link to the RTD site to the repo readme. |
|
We also need to add text on the versioning scheme. We settled on CalVer (https://calver.org/) with |
Co-authored-by: Copilot <copilot@github.com>
|
@beckermr I think this is ready for another look! I can think of automating the api coverage in a future PR... |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
It ended up being simpler using sphinx and rst rather than markdown because we are ingesting the GalSim docstrings. This PR supersedes #204
There are also small scattered changes to some existing jax-galsim docstrings to make sure they follow the galsim docstring format and the correct rst syntax.
Suggestions welcome! the build looks good in my computer and haven't been able to find major issues with the API reference