Skip to content

Commit a1e025f

Browse files
authored
Placeholder directory for pre-executed notebooks. (#473)
1 parent 2ab9bb3 commit a1e025f

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

python-project-template/.pre-commit-config.yaml.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ repos:
1616
name: Clear output from Jupyter notebooks
1717
description: Clear output from Jupyter notebooks.
1818
files: \.ipynb$
19+
exclude: ^docs/pre_executed
1920
stages: [commit]
2021
language: system
2122
entry: jupyter nbconvert --clear-output
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
Put your Jupyter notebooks here :)
1+
# Jupyter notebooks to run on-demand.
2+
3+
Jupyter notebooks in this directory will be run each time you render your documentation.
4+
5+
This means they should be able to be run with the resources in the repo, and in various environments:
6+
7+
- any other developer's machine
8+
- github CI runners
9+
- ReadTheDocs doc generation
10+
11+
This is great for notebooks that can run in a few minutes, on smaller datasets.
12+
13+
For notebooks that require large datasets, access to third party APIs, large CPU or GPU requirements, put them in `./pre_executed` instead.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Pre-executed Jupyter notebooks
2+
3+
Jupyter notebooks in this directory will NOT be run in the docs workflows, and will be rendered with
4+
the provided output cells as-is.
5+
6+
This is useful for notebooks that require large datasets, access to third party APIs, large CPU or GPU requirements.
7+
8+
Where possible, instead write smaller notebooks that can be run as part of a github worker, and within the ReadTheDocs rendering process.
9+
10+
To ensure that the notebooks are not run by the notebook conversion process, you can add the following metadata block to the notebook:
11+
12+
```
13+
"nbsphinx": {
14+
"execute": "never"
15+
},
16+
```

0 commit comments

Comments
 (0)