To improve the "Tutorial" page, we will rework existing content into several new sections. We will not substantively change the existing content. However, we will: make the learning outcomes explicit; emphasize recent improvements to opensafely (i.e. opensafely exec); and group the next steps into two pathways.
The "Tutorial" page should:
Make judicious use of screenshots. These need to be updated regularly.
Present, but not discuss, a workflow.
The "Tutorial" page should avoid:
information about Codespaces and dev containers in general. This needs to be updated regularly and is beyond our control.
information about Codespaces opened outside a browser (e.g. opened in Visual Studio Code, JetBrains Gateway, JupyterLab). This needs to be updated regularly and is beyond our control.
There isn't a need to diff between new and existing files, so create a new file for each section and delete the existing file. Add a redirect to docs/_redirects, though.
If you're unsure what makes documentation good, or just unsure why I'm enclosing links in quotation marks, then read:
To improve the "Tutorial" page, we will rework existing content into several new sections. We will not substantively change the existing content. However, we will: make the learning outcomes explicit; emphasize recent improvements to
opensafely
(i.e.opensafely exec
); and group the next steps into two pathways.The "Tutorial" page should:
The "Tutorial" page should avoid:
There isn't a need to diff between new and existing files, so create a new file for each section and delete the existing file. Add a redirect to
docs/_redirects
, though.If you're unsure what makes documentation good, or just unsure why I'm enclosing links in quotation marks, then read:
Introduction
Create a GitHub account
If you have a GitHub account, then skip to the next section.
Create a new repository
Create a new repository from the research template:
Create a Codespace
main
branchGenerate a dataset for the first time
opensafely exec ehrql:v1 generate-dataset analysis/dataset_definition.py
in the Terminal pane and press EnterUpdate the dataset definition
dataset.age
Generate a dataset for the second time
opensafely exec ehrql:v1 generate-dataset analysis/dataset_definition.py
in the Terminal pane and press EnterRun the pipeline
project.yaml
opensafely exec
command from the previous section to thegenerate_dataset
action inproject.yaml
output
and notice that it doesn't contain any filesopensafely run generate_dataset
in the Terminal pane and press Enteroutput
and notice that it containsdataset.csv.gz
opensafely exec
runs a single action outside the pipelineopensafely run
runs a single action inside the pipelinerun_all
actionCreate a scripted action
analysis/report.py
oranalysis/report.R
Add the scripted action to the pipeline
generate_report
actionopensafely run generate_report
in the Terminal pane and press Enteroutput
and notice that it containsreport.png
Commit and push changes
Check the tests pass
Delete the Codespace
Next steps
Application pathway:
Learning pathway: