Skip to content

Add a slide deck walking through the MART tutorial - #27

Merged
roytsmart merged 8 commits into
mainfrom
docs/mart-talk
Oct 1, 2026
Merged

roytsmart merged 8 commits into
mainfrom
docs/mart-talk

Conversation

@roytsmart

@roytsmart roytsmart commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds a 26-slide reveal.js deck that walks collaborators through the "Invert a Synthetic Scene with MART" tutorial step by step. The audience already knows CTIS inversion and is evaluating whether to adopt ctis. It is served next to the docs at talks/mart/ (https://ctis.readthedocs.io/en/latest/talks/mart/ once merged).

Contents

  • Steps 1–15 follow the tutorial cell by cell. Each shows the tutorial's code and what it prints (shapes, units, results), plus the resulting figure.
  • Conventions: named axes (ScalarArray), units, grids as cell edges, and FunctionArray.
  • Under the hood: the IdealInstrument forward model (geometry, conservative-regridding weights, the image() pipeline, backproject()), backprojection as the conservative transpose (the rotated-cell example from regridding.transpose_weights_conservative), and an abridged MartInverter.__call__.
  • Adopting ctis: wrapping a plain NumPy array as input images; OptikaInstrument vs. subclassing AbstractInstrument; timings at tutorial scale; status and roadmap.

Links from the docs

  • A new Talks section on the landing page links to the deck.
  • A note at the top of the MART tutorial links to it too. That link is raw HTML because nbsphinx warns about relative links to files outside the source tree.

How it works

  • docs/_extra/talks/mart/index.html is the deck: plain HTML that loads reveal.js 6.0.2, KaTeX and highlight.js from jsDelivr. html_extra_path = ['_extra'] copies it into the build unchanged.
  • docs/_extra/talks/mart/make_figures.py repeats the tutorial's calculation and saves slide-sized figures, an MP4 of the iterations, and numbers.js. That file holds every printed shape, unit and number the slides quote; the HTML fills them in at load time, so the text can't drift from the code.
  • docs/conf.py runs every _extra/talks/*/make_figures.py in a subprocess on each build. It's a subprocess because the agg backend the script needs would drop the jupyter-sphinx figures if it were set in the Sphinx process.
  • The shot noise uses a fixed seed, applied after the wavelength sum. That has the same Poisson distribution as IdealInstrument.image(), which has no seed argument.
  • .readthedocs.yml installs ffmpeg for the movie. The generated figures are gitignored.

Speaker notes are on every slide (press S), and ?print-pdf gives a PDF.

Test plan

  • Extracted every runnable code block from the slides and executed them in order against main (16 blocks, including the own-images snippet)
  • make_figures.py gives identical numbers across runs and between the local and Read the Docs builds
  • Full local sphinx-build -b html docs docs/_build/html succeeded with no warnings (first revision)
  • Screenshotted all 25 slides at 1920×1080 and fixed layout issues
  • ruff check and black --check pass on the new script
  • Read the Docs preview of this revision

🤖 Generated with Claude Code

https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU

The deck is a reveal.js page in `docs/_extra/talks/mart/`, which Sphinx
copies into the build unchanged, so it is served at `talks/mart/` next to
the rest of the documentation.

`make_figures.py` repeats the tutorial's calculation with a fixed
shot-noise seed and saves slide-sized figures plus the numbers quoted in
the text. `conf.py` runs it on every build so the slides always match the
current code. Read the Docs needs ffmpeg for the reconstruction movie.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (fc49ae6) to head (e499dd5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #27   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          883       883           
=========================================
  Hits           883       883           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

roytsmart and others added 7 commits September 30, 2026 19:56
The audience is collaborators who already know CTIS inversion in depth
and are evaluating whether to adopt this package, so the deck now follows
the tutorial cell by cell instead of explaining the inverse problem.

Each of the 14 steps shows the tutorial's code and what it prints, with
the shapes and units filled in from `make_figures.py` at build time.
New slides cover the package layout, the named-array conventions, the
`IdealInstrument` forward model, an abridged `MartInverter.__call__`,
inverting your own images, plugging in your own instrument model, timings
at tutorial scale, and the roadmap. The lines-of-sight figure is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
Retitle it "Simulating and Inverting a CTIS Observation" and drop the
package-overview slide. The conventions slide now introduces
`ScalarArray` before `FunctionArray` and typesets units with KaTeX.
Step 2 explains `Cartesian2dVectorArray` and
`Cartesian2dVectorLinearSpace`, and plotting the scene with `rgbmesh`
becomes its own step, so there are now 15. The spectrum plots get a
closed frame so they no longer look cut off on the right, and the
remaining Unicode superscripts are typeset with KaTeX.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
The setup lines before the loop move into the speaker notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
Add a slide before the MART internals that reproduces the example from
`regridding.transpose_weights_conservative` with named arrays: one
bright cell regridded onto a rotated grid and back. It shows that the
transpose conserves the total but does not recover the cell, and ties it
to `IdealInstrument.weights_transpose` and to MART's correction.

Restore the setup lines before the loop on the MART internals slide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
Add a Talks section to the landing page, and a note at the top of the
MART tutorial pointing to the slide deck that walks through it.

The tutorial's link is raw HTML because the deck is copied into the
build by `html_extra_path`, and nbsphinx warns about a relative link to
a file that isn't in the source tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
Resolve the conflict in the docs landing page by keeping both new
sections: the Talks section from this branch, followed by the Citation
section from main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
Label the released features with the current version, link the new
Citation section from the last slide, and drop the warning suppression
around MART from the figure script now that ctis handles it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqceVSp8s2msxj1Dr9MrGU
@roytsmart
roytsmart marked this pull request as ready for review October 1, 2026 17:09
@roytsmart
roytsmart merged commit dadf811 into main Oct 1, 2026
12 checks passed
@roytsmart
roytsmart deleted the docs/mart-talk branch October 3, 2026 00:31
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.

1 participant