Lecture material repository for teachers at DMSC School.
There are 6 courses in the summer school. Each course has its own directory for collecting materials in this repository.
- 1-python
- 3-mcstas
- 4-reduction
- 5-analysis
- 6-scicat
- Install pixi.
- Install pre-commit or prek
- Install hooks:
- Either
pre-commit install - Or
prek install
- Either
- Install hooks:
Many of materials are written in notebooks and are published online by jupyter-book.
Here are some tips and tools for writing jupyter notebooks for courses.
Command to clear outputs of all jupyter notebooks in the current directory.
pre-commit run nbstripout -aor
prek run nbstripout -apixi run buildTeachers can add tags into the each cells for building textbooks and exporting workbooks.
These are available tags handled by jupyter-book build or update_workbook.py script.
There are a few tags that are often used. See this page for more options.
hide-cellBothinputandoutputwill be hidden in the published pages.raise-exceptionsIf an exception is expected to be raised from the cell. If you are using this tag withremove-outputtag, consider moving this code snippet to markdown as a code block.remove-outputoutputsof the cell will not be included in the published pages.remove-cellNot included in the rendered book. But still executed! Also used byupdate_workbook.pyscript.skip-executionThe cell is not executed when building the book.
solution: Solution of the exercise. Source code will be replaced with a instruction message.remove-cell: Not included in the workbooks. Also used byjupyter-book.dmsc-school-hint: Collapse the content of the cell in the workbooks. The content can be expanded by clicking on the cell.dmsc-school-keep: Will not be edited or removed. It overwrites all other tags.
We keep student notebooks (without solutions) in https://github.com/ess-dmsc-dram/dmsc-school-notebooks.
To update these, navigate to the Update notebooks section in the Actions tab in that repository and simply run the workflow.
This will create a PR in the notebooks repository with updates to all notebooks.
To add, remove, restrict dependencies, modify pixi.toml, run pixi lock and commit both pixi.toml and pixi.lock.
