WIP: Add documentation site with Material for MkDocs#204
Conversation
Set up full documentation infrastructure with auto-generated API reference from docstrings, narrative guides, and GitHub Pages deployment via CI. - Add mkdocs-material and mkdocstrings[python] as docs dependencies - Create mkdocs.yml with Material theme, left sidebar nav, Mermaid, MathJax - Add narrative pages: home, getting started, architecture, notable differences - Add API reference stubs for all public modules targeting specific classes - Add GitHub Actions workflow for build on PR / deploy on push to main Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove duplicated explanations, tighten prose, and condense sections that repeated information already covered on other pages. Net reduction of ~80 lines with no content loss -- cross-links replace duplication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the architecture/ pages (pytree, implements, gsobject, drawing) and key-concepts page. Consolidate their most useful content into notable-differences.md, which now thoroughly covers immutability, array views, RNG, PyTree registration, control flow/tracing, profile restrictions, numerical precision, and the @implements decorator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merging this PR will improve performance by 34.54%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | test_benchmark_interpimage_flux_frac[run] |
2.2 ms | 1.6 ms | +34.54% |
Comparing documentation (75f9767) with main (ef2c37a)
|
|
||
| ## Supported APIs | ||
|
|
||
| ??? note "Click to expand the full list of implemented APIs" |
There was a problem hiding this comment.
Is this AI slop or actual markdown.
There was a problem hiding this comment.
I think it's actually syntax from the admonition plugin? https://squidfunk.github.io/mkdocs-material/reference/admonitions/#collapsible-blocks
ismael-mendoza
left a comment
There was a problem hiding this comment.
I flagged a couple of cases in the examples provided that don't actually work. @EiffL could you modify as needed?
| ```python | ||
| import jax | ||
|
|
||
| @jax.jit | ||
| def simulate(flux, sigma): | ||
| gal = jax_galsim.Gaussian(flux=flux, sigma=sigma) | ||
| psf = jax_galsim.Gaussian(flux=1.0, sigma=1.0) | ||
| final = jax_galsim.Convolve([gal, psf]) | ||
| return final.drawImage(scale=0.2) | ||
|
|
||
| # First call compiles; subsequent calls are fast | ||
| image = simulate(1e5, 2.0) | ||
| ``` |
There was a problem hiding this comment.
this does not work without setting the gsparams with fft_size and specifying the size of the image to draw
| ```python | ||
| import jax.numpy as jnp | ||
|
|
||
| sigmas = jnp.linspace(1.0, 4.0, 10) | ||
|
|
||
| @jax.vmap | ||
| def batch_simulate(sigma): | ||
| gal = jax_galsim.Gaussian(flux=1e5, sigma=sigma) | ||
| psf = jax_galsim.Gaussian(flux=1.0, sigma=1.0) | ||
| final = jax_galsim.Convolve([gal, psf]) | ||
| return final.drawImage(scale=0.2, nx=64, ny=64).array | ||
|
|
||
| # Simulate all 10 galaxies in parallel | ||
| images = batch_simulate(sigmas) # shape: (10, 64, 64) | ||
| ``` |
There was a problem hiding this comment.
this example also requires specifying the gsparams
Summary
What's included
jit/grad/vmapexamples@implementsdecorator.github/workflows/docs.yml):mkdocs build --stricton PRs,mkdocs gh-deployon push to mainKnown limitations
@implementsdecorator copies GalSim's docstrings at runtime, but mkdocstrings doesn't always pick them up cleanly. RST cross-references (:func:,:class:) from GalSim's docstrings render as literal text rather than links.🤖 Generated with Claude Code