Skip to content

Commit d1b39a7

Browse files
Merge branch 'main' into main
2 parents 670278c + 796e370 commit d1b39a7

77 files changed

Lines changed: 5037 additions & 820 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Check Colab notebooks
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/notebook_source/*.py'
8+
pull_request:
9+
branches: [ main ]
10+
paths:
11+
- 'docs/notebook_source/*.py'
12+
workflow_dispatch:
13+
14+
jobs:
15+
check-colab-notebooks:
16+
name: Check Colab Notebooks
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
with:
26+
version: "latest"
27+
python-version: "3.11"
28+
enable-cache: true
29+
30+
- name: Install dependencies
31+
run: |
32+
uv sync --group notebooks --group docs
33+
34+
- name: Generate Colab notebooks
35+
run: |
36+
make generate-colab-notebooks
37+
38+
- name: Check for differences
39+
run: |
40+
# Get the diff, filtering out cell ID changes (which are randomly generated)
41+
# Filter out: file markers (--- and +++), and "id" lines
42+
MEANINGFUL_DIFF=$(git diff docs/colab_notebooks/ | grep -E '^[+-]' | grep -v '^---' | grep -v '^+++' | grep -vE '^[+-]\s*"id": "[0-9a-fA-F]+",?$' || true)
43+
44+
if [ -z "$MEANINGFUL_DIFF" ]; then
45+
echo "✅ Colab notebooks are up-to-date (ignoring cell ID changes)"
46+
else
47+
echo "❌ Colab notebooks are out of sync with source files"
48+
echo ""
49+
echo "The generated notebooks differ from the committed ones."
50+
echo "Please run 'make generate-colab-notebooks' locally and commit the changes."
51+
echo ""
52+
echo "Differences found:"
53+
echo "$MEANINGFUL_DIFF"
54+
exit 1
55+
fi

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ help:
3636
@echo "🛠️ Utilities:"
3737
@echo " clean - Remove coverage reports and cache files"
3838
@echo " convert-execute-notebooks - Convert notebooks from .py to .ipynb using jupytext"
39+
@echo " generate-colab-notebooks - Generate Colab-compatible notebooks"
3940
@echo " serve-docs-locally - Serve documentation locally"
4041
@echo " check-license-headers - Check if all files have license headers"
4142
@echo " update-license-headers - Add license headers to all files"
@@ -95,6 +96,11 @@ convert-execute-notebooks:
9596
rm docs/notebook_source/*.csv
9697
@echo "✅ Notebooks created in docs/notebooks/"
9798

99+
generate-colab-notebooks:
100+
@echo "📓 Generating Colab-compatible notebooks..."
101+
uv run --group notebooks python docs/scripts/generate_colab_notebooks.py
102+
@echo "✅ Colab notebooks created in docs/colab_notebooks/"
103+
98104
serve-docs-locally:
99105
@echo "📝 Building and serving docs..."
100106
uv sync --group docs
@@ -125,4 +131,4 @@ install-dev-notebooks:
125131
$(call install-pre-commit-hooks)
126132
@echo "✅ Dev + notebooks installation complete!"
127133

128-
.PHONY: clean coverage format format-check lint lint-fix test check-license-headers update-license-headers check-all check-all-fix install install-dev install-dev-notebooks
134+
.PHONY: clean coverage format format-check lint lint-fix test check-license-headers update-license-headers check-all check-all-fix install install-dev install-dev-notebooks generate-colab-notebooks

0 commit comments

Comments
 (0)