Skip to content

Commit

Permalink
&felipeangelimvieira, yarnabrina [MNT] CI step to test that notebooks…
Browse files Browse the repository at this point in the history
… run (#1621)

This adds a CI step to run all the tutorial notebooks.

The test passes if all tutorial notebooks run without error, and can be used to test the fixes in #1615
  • Loading branch information
fkiraly authored Aug 25, 2024
1 parent 2424f5a commit ccb50ab
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ concurrency:
cancel-in-progress: true

jobs:
run-notebook-tutorials:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ".[dev,github-actions,graph,mqf2]"
- name: Run example notebooks
run: build_tools/run_examples.sh
shell: bash

pytest:
name: Run pytest
runs-on: ${{ matrix.os }}
Expand Down
12 changes: 12 additions & 0 deletions build_tools/run_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Script to run all example notebooks.
# copy-paste from sktime's run_examples.sh
set -euxo pipefail

CMD="jupyter nbconvert --to notebook --inplace --execute --ExecutePreprocessor.timeout=600"

for notebook in docs/source/tutorials/*.ipynb; do
echo "Running: $notebook"
$CMD "$notebook"
done
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,12 @@ dev = [
github-actions = ["pytest-github-actions-annotate-failures"]
graph = ["networkx"]
mqf2 = ["cpflows"]

[tool.setuptools]
py-modules = ["pytorch_forecasting"]

[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=70.0.0",
]

0 comments on commit ccb50ab

Please sign in to comment.