Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d5cbc95
DX: make "Run all notebooks" workflow work again
redeboer Apr 14, 2026
5070816
MAINT: remove `pyright` comments
redeboer Apr 14, 2026
c7ee672
MAINT: upgrade lock files
redeboer Apr 14, 2026
d5fb8f9
FIX: downgrade to Plotly v5
redeboer Apr 14, 2026
bc49f78
MAINT: remove `from __future__ import annotations`
redeboer Jan 13, 2026
447c20a
MAINT: upgrade lock files
redeboer May 6, 2026
325ff81
FIX: make notebooks runnable again
redeboer Jan 13, 2026
2130948
MAINT: upgrade lock files
redeboer May 10, 2026
e6093fb
MAINT: upgrade lock files
web-flow May 10, 2026
be533fc
DX: run notebookas that are modified
redeboer May 10, 2026
988d2c2
DX: improve job descriptions and variable names
redeboer May 10, 2026
5dbe08b
DX: set concurrency on notebook workflow
redeboer May 10, 2026
0076fb2
FIX: do not run ignored notebooks
redeboer May 10, 2026
102566c
FIX: make all notebooks runnable again
redeboer May 10, 2026
c8deb4c
MAINT: implement updates from formatters
web-flow May 10, 2026
5ff8af0
MAINT: upgrade lock files
web-flow May 10, 2026
c44185a
MAINT: implement pre-commit autofixes
pre-commit-ci[bot] May 10, 2026
d6f013e
FIX: do not run ignored notebooks
redeboer May 10, 2026
e22f774
ENH: remove cell magic and use string in `cmap`
redeboer May 10, 2026
a584e50
DX: collect notebooks with Pyhton script
redeboer May 10, 2026
ca6c6ff
TEMP: attempt to fix TR-002 and TR-011
redeboer May 10, 2026
34359f6
MAINT: implement updates from formatters
web-flow May 10, 2026
05eded8
DX: build all dependencies before running notebooks
redeboer May 10, 2026
d5061d4
DX: improve PR triggers
redeboer May 10, 2026
5fbb115
MAINT: remove `pip install` statement
redeboer May 10, 2026
d6c1586
MAINT: upgrade lock files
redeboer May 10, 2026
f46a0f5
ENH: widen cell in TR-027
redeboer May 10, 2026
5e10dce
FIX: undo unwanted Prettier formatting
redeboer May 10, 2026
780d596
DX: force terminal color
redeboer May 10, 2026
741e8b9
DX: print which environment is initialized
redeboer May 10, 2026
93b89b3
MAINT: rename `ini_options` section
redeboer May 10, 2026
1871525
FIX: set correct path trigger
redeboer May 10, 2026
2f4a1bc
MAINT: upgrade lock files
web-flow May 10, 2026
f21e4cb
MAINT: implement pre-commit autofixes
pre-commit-ci[bot] May 10, 2026
fd3763b
FIX: remove `ini_options`
redeboer May 10, 2026
33846f1
DX: increase time limit
redeboer May 10, 2026
487c259
DX: increase time limit
redeboer May 11, 2026
2364424
MAINT: upgrade lock files
web-flow May 11, 2026
3ebd013
MAINT: upgrade lock files
web-flow May 11, 2026
a4e5b7d
MAINT: upgrade lock files
redeboer May 11, 2026
4d93603
FIX: make TR-002 runnable again
redeboer May 11, 2026
527026d
MAINT: revert TR-011 (not runnable)
redeboer May 11, 2026
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
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"PINF",
"Richman",
"absl",
"addopts",
"aitchison",
"allclose",
"arange",
Expand Down Expand Up @@ -84,6 +85,7 @@
"epsrel",
"eqnarray",
"errordef",
"esac",
"facecolor",
"facecolors",
"fcode",
Expand Down Expand Up @@ -166,6 +168,7 @@
"nstar",
"numpycode",
"operatorname",
"parentsize",
"pathlib",
"pbar",
"pcolormesh",
Expand Down
44 changes: 44 additions & 0 deletions .github/collect_notebooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""Print notebooks changed relative to a base ref, excluding pytest --ignore paths."""
# /// script
# requires-python = ">=3.11"
# ///

from __future__ import annotations

import subprocess # noqa: S404
import sys
from pathlib import Path

import tomllib # ty:ignore[unresolved-import]


def main() -> None:
base_ref = sys.argv[1] if len(sys.argv) > 1 else "main"
changed = subprocess.check_output( # noqa: S603
["git", "diff", "--name-only", f"origin/{base_ref}...HEAD"], # noqa: S607
text=True,
).splitlines()

notebooks: set[Path] = set()
for path_str in changed:
path = Path(path_str)
if path.suffix == ".ipynb":
notebooks.add(path)
elif path.name == "uv.lock":
notebooks.update(path.parent.glob("*.ipynb"))

with open("pyproject.toml", "rb") as f:
addopts = tomllib.load(f)["tool"]["pytest"]["addopts"]
ignored = [
Path(o[len("--ignore=") :]) for o in addopts if o.startswith("--ignore=")
]

def is_ignored(nb: Path) -> bool:
return any(nb == ig or ig in nb.parents for ig in ignored)

result = sorted(nb for nb in notebooks if not is_ignored(nb))
print(" ".join(str(nb) for nb in result)) # noqa: T201


if __name__ == "__main__":
main()
46 changes: 41 additions & 5 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,60 @@
name: Run all notebooks
name: Run notebooks

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: |-
${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}

env:
FORCE_COLOR: true

on:
workflow_dispatch:
inputs:
notebook-selector:
description: Relative path to notebooks
description: Space-separated paths to notebooks (runs all if omitted)
required: false
type: string
pull_request:
branches:
- main
- epic/*
- "[0-9]+.[0-9]+.x"
paths:
- docs/**

jobs:
pytest:
name: Test all notebooks
name: Test notebooks
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@v6
- name: Install graphviz
run: sudo apt-get -y install graphviz
- name: Run all notebooks
run: uv run --extra test pytest ${{ github.event.inputs.notebook-selector }}
- name: Collect notebooks to test
id: notebooks
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
selector=$(uv run .github/collect_notebooks.py "${{ github.base_ref }}")
else
selector="${{ github.event.inputs.notebook-selector }}"
fi
echo "selector=$selector" >> $GITHUB_OUTPUT
- name: Initialize environments
if: github.event_name != 'pull_request' || steps.notebooks.outputs.selector != ''
run: |
for notebook in ${{ steps.notebooks.outputs.selector }}; do
project=$(dirname "$notebook")
echo
echo "--== Initializing project $project ==--"
uv run --project="$project" true
done
- name: Run notebooks
if: github.event_name != 'pull_request' || steps.notebooks.outputs.selector != ''
run: uv run --group test --no-dev pytest ${{ steps.notebooks.outputs.selector }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.8.9
rev: 0.8.10
hooks:
- id: check-dev-files
args:
Expand Down Expand Up @@ -79,7 +79,7 @@ repos:
)$

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.10
rev: v0.15.12
hooks:
- id: ruff-check
args: [--fix]
Expand Down Expand Up @@ -166,6 +166,6 @@ repos:
types_or: [python, pyi, jupyter]

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.6
rev: 0.11.13
hooks:
- id: uv-lock
2 changes: 0 additions & 2 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
*.svg
_inventory.md

002/*-tree
002/*-graph
013/graph?
018/graph
17 changes: 2 additions & 15 deletions docs/000/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@
"<!-- cspell:disable -->"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"%pip install -q black==21.5b2 jax==0.4.28 jaxlib==0.4.28 numpy==1.23 sympy==1.8"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -894,7 +881,7 @@
"kernelspec": {
"display_name": "Pyproject Local",
"language": "python",
"name": "python3"
"name": "pyproject_local_kernel"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -906,7 +893,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.12"
"version": "3.13.13"
},
"orphan": true
},
Expand Down
13 changes: 13 additions & 0 deletions docs/000/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[project]
dependencies = [
"black",
"jax",
"numpy~=1.23.0",
"sympy",
]
name = "technical-report"
requires-python = "~=3.11.0"
version = "0.1.0"

[tool.ruff]
preview = true

Expand All @@ -15,3 +26,5 @@ select = ["ALL"]

[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["display"]

[tool.uv.workspace]
Loading
Loading