📚 DOCS: Add new tutorial modules#7205
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7205 +/- ##
==========================================
- Coverage 80.28% 80.28% -0.00%
==========================================
Files 577 577
Lines 45545 45547 +2
==========================================
+ Hits 36562 36563 +1
- Misses 8983 8984 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dcfd575 to
6a52d64
Compare
CalcJob concepts, static script, cleaner UX
Intro:
- Add teaser section heading with TODO checklist for showcasing key
features (WorkGraph, error handling, querying, visualization)
- Fix module count: six → seven
Module 1:
- Add tip about `verdi node graph generate <PK>` CLI alternative
Module 2:
- Introduce CalcJob concept properly before first use, explain
difference to calcfunction, link to topics/how-to docs
- Reference static script file (gp/reaction-diffusion.py) via
literalinclude + dropdown instead of writing 100-line script
on-the-fly
- Make work_dir creation visible (was hidden as tutorial_dir)
- Access output via node.outputs (AiiDA pattern) instead of results dict
- Hide parser function cell (hide-cell tag)
- Fix failure demo: remove outputs/parser from failing run so
aiida-shell surfaces the actual non-zero exit status instead of
misleading 303
- Put load_profile instructions in proper code block
- Suppress write_text() return value ("80") with semicolons
- Rephrase Computer/Code section to acknowledge verdi presto
- Add cross-references to topics:calculations, how-to:run-codes,
how-to:plugin-codes throughout
- Update learning objectives and summary to match actual content
Move inline code snippets (simulation script, parser, plotting) from
markdown code cells to standalone `.py` files under `include/`. This
enables LSP support (type checking, autocomplete) for tutorial code and
uses `{literalinclude}` + `{dropdown}` for display, `%run -i` for
notebook execution.
All three files pass mypy --strict, and ruff:
Also updates module1.md to use `%run -i include/plot_fields.py` instead
of inline matplotlib code.
Tutorials infrastructure:
- Add `_ext/inline_downloads.py` Sphinx extension that post-processes
downloaded notebooks: inlines `%run -i` files, converts MyST
admonitions to HTML alert divs, dropdowns to `<details>`,
literalinclude to code blocks, and strips MyST-only roles/labels —
making notebooks fully self-contained and Jupyter-compatible
- Add `{nb-download}` links to module1 and module2 for one-click
download
- Register extension in conf.py
Content:
- Add `teaser.md`: user-focused preview of AiiDA capabilities
(monitoring, error recovery, querying, provenance, sharing, workflow
extensibility)
- Convert `index.rst` → `index.md` (MyST); separate "AiiDA in Action"
card above the module grid; update redirects.txt accordingly
- Generalize example-specific language in headings, learning objectives,
and module tables across intro.md, module3.md, and module6.md
Tutorial code cleanup:
- Extract inline `simulate()` from module1.md to typed
`include/simulate.py` with `SimParams(TypedDict)`, loaded via `%run
-i`
- Extract provenance graph boilerplate to `include/plot_provenance.py`
- Add IPython magic commands note in module1.md explaining `%run -i`,
`%verdi`, and `%load_ext aiida`
- Pre-register `InstalledCode('python3')` in module2.md hidden cell so
`verdi process list` shows `python3@localhost` instead of full venv
path
| print(f"Fields shape: {data['U_final'].shape}") | ||
| ``` | ||
|
|
||
| ## Visualizing the results |
There was a problem hiding this comment.
As a side note: less inputs. Make some a default (probably seed?) Unless the are necessary for later (randomization?). Anyways, make the input file as small as possible for our needs.
There was a problem hiding this comment.
Also, maybe merge this section with the part that shows the results from the last one?
So we have
- Running the simulation
- Results
- ...
There was a problem hiding this comment.
Done! Added a static image of the UV fields right at the top of the module (below the intro text), so readers immediately see what the simulation produces. Merged the "Visualizing the results" section into "Running the simulation" (no separate heading). Removed Fields shape output. Re: reducing inputs, seed is already optional in the script (defaults to None), so the input file could drop it. Will revisit when simplifying further. Input file is anyway not shown atm. Could not be bothered to leave my beautiful terminal yet, to create a such a scheme, as you suggest, but we can do it when we also create the package!

Rendered view here:
https://aiida--7205.org.readthedocs.build/projects/aiida-core/en/7205/tutorials/index.html
Warning
If RTD build in CI failed, the rendered view I link here is outdated!!
The important source files to review are:
docs/source/tutorials/module*.md