Skip to content

Sphinx documentation#226

Merged
beckermr merged 34 commits into
mainfrom
sphinx-docs
May 1, 2026
Merged

Sphinx documentation#226
beckermr merged 34 commits into
mainfrom
sphinx-docs

Conversation

@ismael-mendoza
Copy link
Copy Markdown
Collaborator

@ismael-mendoza ismael-mendoza commented Apr 30, 2026

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

ismael-mendoza and others added 16 commits April 30, 2026 17:43
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>"
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 30, 2026

Merging this PR will improve performance by ×2

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 9 improved benchmarks
✅ 27 untouched benchmarks

Performance Changes

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)

Open in CodSpeed

@beckermr
Copy link
Copy Markdown
Collaborator

Can we add a build on readthedocs or github pages or something so that we can preview changes?

@beckermr
Copy link
Copy Markdown
Collaborator

I requested RTD for this repo.

@ismael-mendoza
Copy link
Copy Markdown
Collaborator Author

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)

@ismael-mendoza
Copy link
Copy Markdown
Collaborator Author

ismael-mendoza commented May 1, 2026

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...

ismael-mendoza and others added 2 commits May 1, 2026 08:43
Co-authored-by: GitHub Copilot <copilot@github.com>
@ismael-mendoza
Copy link
Copy Markdown
Collaborator Author

@beckermr it's available now! you just need to click on the RTD build below

ismael-mendoza and others added 2 commits May 1, 2026 09:04
Co-authored-by: GitHub Copilot <copilot@github.com>

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

I left some general comments. Overall, this looks great!

Comment thread docs/api/interpolation.rst Outdated
Comment thread docs/api/noise.rst Outdated
Comment thread docs/api/wcs.rst Outdated
Comment thread docs/api/image.rst Outdated
Comment thread docs/api/wcs.rst Outdated
Comment thread docs/index.rst
Comment thread docs/notable-differences.rst Outdated
Comment thread docs/api/core.rst
Comment thread docs/api/noise.rst Outdated
@beckermr
Copy link
Copy Markdown
Collaborator

beckermr commented May 1, 2026

We should also add a link to the RTD site to the repo readme.

@beckermr
Copy link
Copy Markdown
Collaborator

beckermr commented May 1, 2026

We also need to add text on the versioning scheme. We settled on CalVer (https://calver.org/) with YYYY.MM.MICRO with MICRO resetting to 0 at the start of each month.

Comment thread docs/index.rst Outdated
Comment thread docs/sharp-bits.rst Outdated
@ismael-mendoza ismael-mendoza marked this pull request as ready for review May 1, 2026 18:27
@ismael-mendoza ismael-mendoza requested a review from beckermr May 1, 2026 18:32
@ismael-mendoza
Copy link
Copy Markdown
Collaborator Author

ismael-mendoza commented May 1, 2026

@beckermr I think this is ready for another look!

I can think of automating the api coverage in a future PR...

Comment thread docs/_ext/galsim_docstring.py Outdated
@beckermr
Copy link
Copy Markdown
Collaborator

beckermr commented May 1, 2026

pre-commit.ci autofix

Comment thread docs/sharp-bits.rst Outdated
@beckermr beckermr enabled auto-merge (squash) May 1, 2026 20:31
@beckermr beckermr merged commit 44aa3f6 into main May 1, 2026
9 checks passed
@beckermr beckermr deleted the sphinx-docs branch May 1, 2026 20:35
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