You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📚 tutorials: fetch include/ helpers if not present
Readers who copy-paste cells into their own notebook, rather than
cloning the repo, had no include/ folder, so setup_tutorial.py,
input.yaml and the shared task/workflow modules were missing and every
notebook failed on its first include/ reference.
Each module's setup cell now downloads setup_tutorial.py when it is
absent; setup_tutorial.py then fetches the remaining include/ files via
the GitHub contents API. Both checks are guarded, so a repo clone and
the docs build make no network call. Module 0, which has no setup cell,
fetches its two example inputs directly.
The source ref is pinned to the PR branch for now (TODO in
setup_tutorial.py); switch it to the release tag on merge.
Copy file name to clipboardExpand all lines: docs/source/tutorials/module1.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,22 +64,32 @@ It sets up a lightweight local profile with sensible defaults for all three: SQL
64
64
For more advanced high-throughput production setups, see the {ref}`installation guide <installation>`.
65
65
66
66
This tutorial, though, runs in its own **isolated sandbox profile**, kept separate from any profile you already have, so the data you create here never mixes with your real work and every module reproduces exactly.
67
-
Run the cell below to create it (later modules load the same one):
67
+
68
+
The cell below creates that profile and loads AiiDA's `%verdi` Jupyter magic.
69
+
If you are running outside the tutorial repository (for example, cells pasted into your own notebook), it first downloads `setup_tutorial.py`, which in turn fetches the other `include/` helpers it needs; inside the repo, as in these rendered docs, that step is skipped.
70
+
Every module runs this same cell, so the data you create now is still available in later modules:
68
71
69
72
```{code-cell} ipython3
70
-
# Create (or load) the tutorial's isolated sandbox profile. It stays separate
71
-
# from any AiiDA profile you already have, so nothing here touches your real
72
-
# work. Every module loads this same profile, so data you create now is still
73
-
# there in later modules.
74
-
# `%load_ext aiida` enables the `%verdi` magic used throughout the tutorial.
75
-
#
76
-
# Prefer to use your own existing profile? Replace the `%run` line with:
77
-
# from aiida import load_profile
78
-
# load_profile()
73
+
# Set up the tutorial's isolated sandbox profile.
74
+
from pathlib import Path
75
+
76
+
if not Path('include/setup_tutorial.py').exists():
0 commit comments