Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/notebook-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Notebook smoke

on:
pull_request:
paths:
- "_notebooks/**/*.ipynb"
- "scripts/smoke_notebooks.py"
- "requirements-smoke.txt"
- ".github/workflows/notebook-smoke.yml"
schedule:
# Weekly full suite (Sunday 04:00 UTC)
- cron: "0 4 * * 0"
workflow_dispatch:
inputs:
only:
description: "Optional notebook prefixes (space-separated), e.g. 01 13. Empty = all."
required: false
default: ""

concurrency:
group: notebook-smoke-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: requirements-smoke.txt

- name: Install smoke dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-smoke.txt

- name: Cache pods / notebook data downloads
uses: actions/cache@v4
with:
path: |
~/.pods_data
_notebooks/data
key: pods-data-${{ runner.os }}-${{ hashFiles('requirements-smoke.txt') }}
restore-keys: |
pods-data-${{ runner.os }}-

- name: Run notebook smoke tests
env:
MPLBACKEND: Agg
JUPYTER_PLATFORM_DIRS: "1"
run: |
set -euo pipefail
ONLY="${{ github.event.inputs.only }}"
if [ -n "${ONLY}" ]; then
# shellcheck disable=SC2086
python scripts/smoke_notebooks.py --only ${ONLY}
else
python scripts/smoke_notebooks.py
fi

- name: Upload smoke results
if: always()
uses: actions/upload-artifact@v4
with:
name: notebook-smoke-results
path: |
_notebooks/test-results/summary.json
_notebooks/test-results/*.ok
_notebooks/test-results/*.fail
if-no-files-found: ignore
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ _site/

# Ruby bundler
.bundle/

# Local Python env and notebook smoke artefacts
.venv/
_notebooks/test-results/
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ Deep GP notebooks install teaching helpers via LaMD `\installcode{}` cells, typi

Pinball and related Deep GP teaching methods live in [`lawrennd/mlai`](https://github.com/lawrennd/mlai), not in PyDeepGP itself; lecture setup monkey-patches them onto `deepgp.DeepGP`.

## Notebook smoke tests

Execute every numbered lecture notebook under `_notebooks/` with CI-safe patches (Agg backend, mocked stdin, capped `optimize`, no widget hangs):

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements-smoke.txt
python scripts/smoke_notebooks.py
# subset: python scripts/smoke_notebooks.py --only 01 13
```

GitHub Actions runs the same harness on pull requests that touch notebooks or the smoke files, weekly on a schedule, and via **workflow_dispatch** (optional `--only` input). Results land in `_notebooks/test-results/` (gitignored) and as a workflow artifact.

## Layout

| Path | Role |
Expand Down
2 changes: 1 addition & 1 deletion _lamd/_lamd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ layout: lecture
venue: Gaussian Process Summer School
talktheme: white
talkcss: mlatcl.css
talkfontsize: small
talkfontsize: smaller
bibdir: $HOME/lawrennd/bibliography/
people: ../_people/people.yml
postsdir: ../_lectures/
Expand Down
27 changes: 27 additions & 0 deletions requirements-smoke.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Runtime + execution harness for lecture notebook smoke tests.
# Install: pip install -r requirements-smoke.txt

# Notebook execution
nbclient>=0.10,<1
nbformat>=5.10,<6
ipykernel>=6.29
ipywidgets>=8.1
ipython>=8.0

# Teaching stack (match README notebook dependencies)
GPy>=1.13
git+https://github.com/SheffieldML/PyDeepGP.git#egg=DGP
git+https://github.com/lawrennd/mlai.git#egg=mlai
git+https://github.com/lawrennd/ods.git#egg=pods
git+https://github.com/lawrennd/notutils.git#egg=notutils

# Used by lecture notebooks
matplotlib>=3.8
numpy>=1.26
scipy>=1.11
pandas>=2.0
scikit-learn>=1.3
emukit>=0.4
Pillow>=10.0
# PGM diagrams (import name is still `daft`; PyPI `daft` is unrelated)
daft-pgm>=0.1.2
Loading
Loading