Skip to content

Commit 44aa3f6

Browse files
ismael-mendozaGitHub Copilotbeckermrpre-commit-ci[bot]
authored
Sphinx documentation (#226)
* chore: add docs optional-dependency group to pyproject.toml 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> * docs: add Sphinx configuration, custom extension, and static assets - 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> * docs: add index page and API reference RST sources - 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> * style: format pyproject toml * docs: fix docstrings so they follow rst syntax and galsim style Co-authored-by: Copilot <copilot@github.com> Co-authored-by: GitHub Copilot <copilot@github.com> * docs: add sharp bits block to emphasize classes that have a LAX description which is usually very important Co-authored-by: Copilot <copilot@github.com> Co-authored-by: GitHub Copilot <copilot@github.com> * ci: add make docs workflow Co-authored-by: GitHub Copilot <copilot@github.com> * docs: interpolated image before interpolatns * docs: small clarification * docs: not needed * style: formatting * docs: add user-facing guide pages (installation, quickstart, notable-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>" * docs: expand index page and reorganise core API page - 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>" * docs: rst fix indentation * docs: fix rst indentation * docs: add Read the Docs configuration file Co-authored-by: GitHub Copilot <copilot@github.com> * Trigger RTD Build * docs: fix some rst synxtax errors (single ticks, bullet indentation) Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Copilot <copilot@github.com> * docs: github action not needed since we are using RTD now * docs: use sharp bits instead of notable-difefrences * docs: use sharp bits * docs: note about core not intended for public usage * docs: changes suggested by Matt to align more with GalSim * docs: add documentation link to readme Co-authored-by: Copilot <copilot@github.com> * docs: small correction * Apply suggestion from @beckermr * Apply suggestion from @beckermr * docs: added versioning and API policy * docs: title underlin too short * docs: forgot this note * Apply suggestion from @beckermr * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Apply suggestion from @beckermr --------- Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f04b831 commit 44aa3f6

32 files changed

Lines changed: 1870 additions & 396 deletions

.readthedocs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Read the Docs configuration
2+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
3+
4+
version: 2
5+
6+
build:
7+
os: ubuntu-24.04
8+
tools:
9+
python: "3.12"
10+
commands:
11+
- pip install uv
12+
- uv sync --extra docs
13+
- uv run sphinx-build -b html docs $READTHEDOCS_OUTPUT/html
14+
15+
sphinx:
16+
configuration: docs/conf.py
17+
fail_on_warning: false

README.md

Lines changed: 5 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
**JAX port of GalSim, for parallelized, GPU accelerated, and differentiable galaxy image simulations.**
44

5-
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) [![Python package](https://github.com/GalSim-developers/JAX-GalSim/actions/workflows/python_package.yaml/badge.svg)](https://github.com/GalSim-developers/JAX-GalSim/actions/workflows/python_package.yaml) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/GalSim-developers/JAX-GalSim/main.svg)](https://results.pre-commit.ci/latest/github/GalSim-developers/JAX-GalSim/main) [![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/GalSim-developers/JAX-GalSim)
5+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) [![Python package](https://github.com/GalSim-developers/JAX-GalSim/actions/workflows/python_package.yaml/badge.svg)](https://github.com/GalSim-developers/JAX-GalSim/actions/workflows/python_package.yaml) [![Documentation Status](https://readthedocs.org/projects/jax-galsim/badge/?version=latest)](https://jax-galsim.readthedocs.io/en/latest/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/GalSim-developers/JAX-GalSim/main.svg)](https://results.pre-commit.ci/latest/github/GalSim-developers/JAX-GalSim/main) [![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/GalSim-developers/JAX-GalSim)
66

77
**Disclaimer**: This project is still in an early development phase, **please use the [reference GalSim implementation](https://github.com/GalSim-developers/GalSim) for any scientific applications.**
88

9+
**You can find the most up-to-date documentation for the project [here](https://jax-galsim.readthedocs.io/en/latest).**
10+
11+
912
## Objective and Design
1013

1114
The goal of this library is to reimplement GalSim functionalities in pure JAX to allow for automatic differentiation, GPU acceleration, and batched computations.
@@ -44,124 +47,4 @@ about the inner workings of GalSim and how to code in JAX.
4447

4548
## Current GalSim API Coverage
4649

47-
<!-- start-api-coverage -->
48-
JAX-GalSim has implemented 22.5% of the GalSim API. See the list below for the supported APIs.
49-
50-
<details>
51-
52-
- galsim.Add
53-
- galsim.AffineTransform
54-
- galsim.Angle
55-
- galsim.AngleUnit
56-
- galsim.BaseDeviate
57-
- galsim.BaseNoise
58-
- galsim.BaseWCS
59-
- galsim.BinomialDeviate
60-
- galsim.Bounds
61-
- galsim.BoundsD
62-
- galsim.BoundsI
63-
- galsim.Box
64-
- galsim.CCDNoise
65-
- galsim.CelestialCoord
66-
- galsim.Chi2Deviate
67-
- galsim.Convolution
68-
- galsim.Convolve
69-
- galsim.Cubic
70-
- galsim.Deconvolution
71-
- galsim.Deconvolve
72-
- galsim.Delta
73-
- galsim.DeltaFunction
74-
- galsim.DeviateNoise
75-
- galsim.Exponential
76-
- galsim.FitsHeader
77-
- galsim.FitsWCS
78-
- galsim.GSFitsWCS
79-
- galsim.GSObject
80-
- galsim.GSParams
81-
- galsim.GalSimBoundsError
82-
- galsim.GalSimConfigError
83-
- galsim.GalSimConfigValueError
84-
- galsim.GalSimDeprecationWarning
85-
- galsim.GalSimError
86-
- galsim.GalSimFFTSizeError
87-
- galsim.GalSimHSMError
88-
- galsim.GalSimImmutableError
89-
- galsim.GalSimIncompatibleValuesError
90-
- galsim.GalSimIndexError
91-
- galsim.GalSimKeyError
92-
- galsim.GalSimNotImplementedError
93-
- galsim.GalSimRangeError
94-
- galsim.GalSimSEDError
95-
- galsim.GalSimUndefinedBoundsError
96-
- galsim.GalSimValueError
97-
- galsim.GalSimWarning
98-
- galsim.GammaDeviate
99-
- galsim.Gaussian
100-
- galsim.GaussianDeviate
101-
- galsim.GaussianNoise
102-
- galsim.Image
103-
- galsim.ImageCD
104-
- galsim.ImageCF
105-
- galsim.ImageD
106-
- galsim.ImageF
107-
- galsim.ImageI
108-
- galsim.ImageS
109-
- galsim.ImageUI
110-
- galsim.ImageUS
111-
- galsim.Interpolant
112-
- galsim.InterpolatedImage
113-
- galsim.JacobianWCS
114-
- galsim.Lanczos
115-
- galsim.Linear
116-
- galsim.Moffat
117-
- galsim.Nearest
118-
- galsim.OffsetShearWCS
119-
- galsim.OffsetWCS
120-
- galsim.PhotonArray
121-
- galsim.Pixel
122-
- galsim.PixelScale
123-
- galsim.PoissonDeviate
124-
- galsim.PoissonNoise
125-
- galsim.Position
126-
- galsim.PositionD
127-
- galsim.PositionI
128-
- galsim.Quintic
129-
- galsim.Sensor
130-
- galsim.Shear
131-
- galsim.ShearWCS
132-
- galsim.SincInterpolant
133-
- galsim.Spergel
134-
- galsim.Sum
135-
- galsim.TanWCS
136-
- galsim.Transform
137-
- galsim.Transformation
138-
- galsim.UniformDeviate
139-
- galsim.VariableGaussianNoise
140-
- galsim.WeibullDeviate
141-
- galsim.bessel.j0
142-
- galsim.bessel.kv
143-
- galsim.bessel.si
144-
- galsim.fits.closeHDUList
145-
- galsim.fits.readCube
146-
- galsim.fits.readFile
147-
- galsim.fits.readMulti
148-
- galsim.fits.write
149-
- galsim.fits.writeFile
150-
- galsim.fitswcs.CelestialWCS
151-
- galsim.integ.int1d
152-
- galsim.noise.addNoise
153-
- galsim.noise.addNoiseSNR
154-
- galsim.random.permute
155-
- galsim.utilities.g1g2_to_e1e2
156-
- galsim.utilities.horner
157-
- galsim.utilities.printoptions
158-
- galsim.utilities.unweighted_moments
159-
- galsim.utilities.unweighted_shape
160-
- galsim.wcs.EuclideanWCS
161-
- galsim.wcs.LocalWCS
162-
- galsim.wcs.UniformWCS
163-
164-
</details>
165-
<!-- end-api-coverage -->
166-
167-
_**Note**: The coverage list is generated automatically by the `scripts/update_api_coverage.py` script. To update it, run `python scripts/update_api_coverage.py` from the root of the repository._
50+
JAX-GalSim current has implemented **22.5%** of the GalSim API. See the corresponding [documentation page](https://jax-galsim.readthedocs.io/en/latest/api-coverage) for a list of what is currently implemented.

docs/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Minimal Sphinx Makefile — uses uv run so all package deps are always available.
2+
3+
SPHINXBUILD = uv run sphinx-build
4+
SOURCEDIR = .
5+
BUILDDIR = _build
6+
7+
.PHONY: help html clean livehtml
8+
9+
help:
10+
@echo "Usage:"
11+
@echo " make html Build the HTML documentation"
12+
@echo " make clean Remove the build directory"
13+
@echo " make livehtml Auto-rebuild on file changes (requires sphinx-autobuild)"
14+
15+
html:
16+
$(SPHINXBUILD) -b html $(SOURCEDIR) $(BUILDDIR)/html
17+
18+
clean:
19+
rm -rf $(BUILDDIR)
20+
21+
livehtml:
22+
uv run sphinx-autobuild $(SOURCEDIR) $(BUILDDIR)/html \
23+
--ignore "**/_build/**" \
24+
--ignore "**/.DS_Store"

0 commit comments

Comments
 (0)