Skip to content

Commit

Permalink
Check output cells of notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmarwitz committed Dec 13, 2024
1 parent a5a6fc3 commit 2bf8bd1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nb-output-exists.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
for notebook in docs/examples/*.ipynb; do
# Check the notebook for null execution counts
if ! jq -e '.cells | map(select(.cell_type == "code") | .execution_count != null) | all' "$notebook" > /dev/null; then
echo "Error: $notebook has code cells with null execution counts."
exit 1
fi
done

# If all notebooks are valid
echo "All notebooks have valid execution counts."
exit 0

0 comments on commit 2bf8bd1

Please sign in to comment.