Skip to content

Migrate examples to Jupyter notebooks#136

Closed
THargreaves wants to merge 14 commits into
mainfrom
th/colab-examples
Closed

Migrate examples to Jupyter notebooks#136
THargreaves wants to merge 14 commits into
mainfrom
th/colab-examples

Conversation

@THargreaves

@THargreaves THargreaves commented Feb 19, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions

Copy link
Copy Markdown
Contributor

SSMProblems.jl/SSMProblems documentation for PR #136 is available at:
https://TuringLang.github.io/SSMProblems.jl/SSMProblems/previews/PR136/

@codecov

codecov Bot commented Feb 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.14%. Comparing base (57320d5) to head (30ce9ab).

Files with missing lines Patch % Lines
GeneralisedFilters/docs/notebook.jl 0.00% 50 Missing ⚠️
...lisedFilters/examples/trend-inflation/utilities.jl 0.00% 10 Missing ⚠️
GeneralisedFilters/docs/make.jl 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
+ Coverage   82.42%   83.14%   +0.71%     
==========================================
  Files          54       53       -1     
  Lines        2794     2770      -24     
==========================================
  Hits         2303     2303              
+ Misses        491      467      -24     
Flag Coverage Δ
GeneralisedFilters 84.40% <0.00%> (+0.74%) ⬆️
SSMProblems 42.85% <ø> (ø)

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.

@github-actions

Copy link
Copy Markdown
Contributor

SSMProblems.jl/GeneralisedFilters documentation for PR #136 is available at:
https://TuringLang.github.io/SSMProblems.jl/GeneralisedFilters/previews/PR136/

@shravanngoswamii

Copy link
Copy Markdown
Member

Sorry @THargreaves, didn't noticed your PR because it wasn't attached in the issue. I opened same PR that generates notebook from existing scripts: #137

Feel free to review, approve or reject!

yebai and others added 6 commits June 23, 2026 21:27
# Conflicts:
#	.github/workflows/Documentation.yml
The container refactor merged from main (#151) changed `get_ancestry` to
return `ReferenceTrajectory`s rather than `Vector{Vector{RBState}}`, which
broke `mean_path`'s dispatch and the notebook's plotting cells. Collect each
trajectory before extracting state components; verified the regenerated plots
are byte-identical to the pre-merge baseline.

Also guard docs example discovery so only directories shipping the expected
`<slug>.ipynb` are built, skipping script-only example dirs (e.g. the
`PGAS Example` added on main) instead of failing the build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes from reviewing the notebook migration tooling:

- docs cache key: hash GeneralisedFilters/src, SSMProblems/src and the whole
  examples tree, not just *.ipynb, so library/data/Project changes no longer
  serve stale rendered notebook output.
- git hooks: replace `mapfile -d ''` (bash 4.4+) with a portable null-delimited
  read loop so the hooks run on macOS system bash 3.2.
- pre-commit: refuse to run when a staged notebook also has unstaged changes,
  since the re-stage would otherwise sweep those hunks into the commit.
- CI notebook-clean: read notebooks into a null-delimited array instead of
  unquoted word-splitting, so paths with spaces aren't silently skipped.
- notebook.jl inject_docs_badges: slice headings with nextind/prevind so a
  multibyte title (e.g. "# Café") can't throw StringIndexError.
- notebook.jl inject_edit_url: anchor the guard at the start of the page like
  the replacement, so a @meta fence in the body no longer suppresses EditURL.
- sync_notebook_badges.py: require actual badge markup (not a bare URL
  substring) before stripping a line, and keep any content preceding the
  heading instead of discarding it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- CI test matrix: drop the `arch: x64` axis so `setup-julia` uses each
  runner's native arch. `macOS-latest` is now Apple Silicon (arm64), so the
  explicit `x64` request was failing at the Setup Julia step. ubuntu/windows
  remain x64 (their native default). Note: this renames the macOS test checks
  (drops the "- x64" suffix), so any required-status-check names referencing it
  in branch protection need updating.
- make.jl: add explicit `return` in the example-discovery `do` block to satisfy
  the JuliaFormatter (blue) check flagged by reviewdog.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- notebook.jl: restore extract_inline_images, which was accidentally reverted
  in a8b2852 ("Remove output from loading cells"). CairoMakie figures are
  emitted as <img src="data:image/png;base64,..."> which Documenter renders as
  raw text; this extracts them to real PNG files and rewrites them as markdown
  image links. Verified the converted PNGs match the executed figures.
- make.jl example_summary: accumulate the first prose paragraph instead of the
  first physical line, so a hard-wrapped intro sentence isn't truncated
  mid-line (e.g. "...suggested by (Stock &") in the examples index table.
- Documentation.yml: include GeneralisedFilters/docs/*.jl in the notebook-output
  cache key so changes to the rendering scripts bust the cache and re-render,
  rather than serving stale output via notebook.jl's isfile(MARKDOWN) skip.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Link example pages directly under the "Examples" nav section instead of
generating an examples landing/index page. Removes the now-unused index
machinery (write_examples_index and its title/summary/thumbnail/links helpers,
the EXAMPLE_ASSETS_OUT dir, the REPO/PKG_SUBDIR constants) and the orphaned
thumbnail SVGs. /examples/ goes away; /examples/trend-inflation/ stays.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yebai yebai mentioned this pull request Jun 23, 2026
@yebai yebai closed this in #176 Jun 23, 2026
@yebai yebai deleted the th/colab-examples branch June 23, 2026 23:32
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.

3 participants