Skip to content

Commit

Permalink
Check outputs of example notebooks in CI.
Browse files Browse the repository at this point in the history
Check via execution count in a bash script.
  • Loading branch information
thomasmarwitz committed Dec 13, 2024
1 parent 2bf8bd1 commit a506cd4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure

mypy-example-nbs:
name: Check notebooks mypy
check-example-nbs:
name: Check notebooks mypy and output exists
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
Expand All @@ -48,6 +48,7 @@ jobs:
run: |
pixi run nb-convert
pixi run nb-mypy
pixi run nb-assert-output
unit-tests:
name: Unit Tests
Expand Down
1 change: 0 additions & 1 deletion nb-output-exists.sh → nb-output-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ for notebook in docs/examples/*.ipynb; do
fi
done

# If all notebooks are valid
echo "All notebooks have valid execution counts."
exit 0
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ coverage = "pytest tests --cov=metalearners --cov-report=xml --cov-report term-m
# Note that this task will fail on systems without bash.
nb-convert = "nb-convert.sh"
nb-mypy = "mypy docs/examples/*.py"
nb-assert-output = "nb-output-check.sh"

[dependencies]
pre-commit = "*"
Expand Down

0 comments on commit a506cd4

Please sign in to comment.