Tutorial Logistics¶
This activity uses a custom library called compaslab that helps advance through the activity.
Installation¶
The library is packaged, but not deployed in PiPy, so we install it directly from GitHub.
pip install git+git://github.com/ml4sts/outreach-compas.git
Adding a new tutorial¶
Add a notebook file to compaslab/activities
directory in the repository
You can read the ones in there (especially the .md versions) to see an example.
When writing the notebook file, this can be done in a regular notebook or a Myst
markdown notebook. If using Myst (which is good for version control) sync it with
a notebook file using jupytext
by including the following in the header.
jupytext:
formats: md:myst,ipynb
text_representation:
extension: .md
format_name: myst
You can then use
jupytext --sync filename.md
to get the .ipynb
file up to date, this is important because the jupytext
read function in the library doesn’t currently work.
To make a tutorial that has hints put meta data in each cell.
For markdown cells:
+++ {"lecture_tools": {"block": "<name of step>", "type": "<type of cell>"}}
For code cells:
--- lecture_tools: block: <name of step> type: <type of cell> ---
The ---
marks the start and end of the metadata in a code cell.
The name can be whatever, but should be descriptive and typically a few
consecutive cells will have the same name but be different types.
The type can be one of the following:
narrative
template
hint
solution
interpretation
For hint
and template
cells, also include the following in the metadata so
that the recap will work correctly.
tags: [raises-exception]
You can set metadata in the notebook interface too.