Skip to content

Commit bf881e6

Browse files
authored
Merge pull request #148 from pythonhealthdatascience/dev
Dev
2 parents 69eda1b + e9c219f commit bf881e6

58 files changed

Lines changed: 1256 additions & 465 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Dates formatted as YYYY-MM-DD as per [ISO standard](https://www.iso.org/iso-8601-date-and-time-format.html).
77

8+
## v0.4.0 - 2026-01-06
9+
10+
### Added
11+
12+
* Quality assurance page.
13+
* Date each page was last updated (based on commits to main, generated using bash script in GitHub action).
14+
15+
### Changed
16+
17+
* Addressed peer review feedback from Nav Mustafee ([#130](https://github.com/pythonhealthdatascience/des_rap_book/issues/130)).
18+
* Addressed peer review feedback from Fatemeh Alidoost ([#134](https://github.com/pythonhealthdatascience/des_rap_book/issues/134), [#144](https://github.com/pythonhealthdatascience/des_rap_book/issues/144) and [#146](https://github.com/pythonhealthdatascience/des_rap_book/issues/146)).
19+
* Restructured the website so it has a homepage, a dedicated section with step-by-step tutorial, but then separate sections with background information. Now has top navbar with banner, for hopefully more professional appearance and easier navigation.
20+
821
## v0.3.0 - 2025-11-06
922

1023
This release adds new pages on the mathematical proof of correctness, discrete-event simulation, and conclusions/feedback, as well as template repositories for structuring work as a package. It fixes the calculation of R time-weighted measures, updates the Python approach to determining warm-up length, and extends all pages to cover all performance metrics. Numerous smaller improvements are also included.

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ keywords:
4545
- simmer
4646
- rap
4747
license: MIT
48-
version: '0.3.0'
49-
date-released: '2025-11-06'
48+
version: '0.4.0'
49+
date-released: '2026-01-06'

_brand.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# _brand.yml
2+
defaults:
3+
bootstrap:
4+
defaults:
5+
navbar-bg: "#0a4568"

_quarto.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
project:
22
type: website
3+
pre-render:
4+
- bash scripts/make-environment-full.sh
35
preview:
46
browser: true
57
render:
@@ -10,12 +12,15 @@ project:
1012

1113
website:
1214
title: "DES RAP"
15+
site-url: "https://pythonhealthdatascience.github.io/des_rap_book/"
1316
google-analytics: "G-W2FC4GDHFK"
1417
cookie-consent: true
1518
page-navigation: true
19+
search: false
1620
favicon: images/stars_logo_blue.png
1721
navbar:
1822
logo: images/stars_logo_white.png
23+
collapse-below: "sm"
1924
left:
2025
- text: Step-by-step guide
2126
href: pages/guide/introduction.qmd
@@ -125,7 +130,6 @@ format:
125130
html:
126131
theme:
127132
- cosmo
128-
- styles/theme.scss
129133
toc: true
130134
toc-depth: 2
131135
number-sections: false

pages/frameworks/levels_of_rap.qmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ It is © 2024 Crown Copyright (NHS England), shared under the terms of the [Open
2020

2121
The specific version of the framework copied below is that from commit [2549256](https://github.com/NHSDigital/rap-community-of-practice/commit/2549256498886d6d7ea4cdb736e2a2864c8bb461) (9th September 2024).
2222

23+
::: {.blue}
24+
25+
This book follows the NHS Levels of RAP framework because it is a practical, well-established approach to building full Reproducible Analytical Pipelines in the NHS healthcare setting.
26+
Although NHS-specific, the principles are still broadly useful for analytical work beyond the NHS.
27+
28+
:::
29+
2330
### 🥉 Baseline
2431

2532
RAP fundamentals offering resilience against future change.

pages/frameworks/stars_reproducibility.qmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ As part of the [STARS project](https://pythonhealthdatascience.github.io/stars/)
2020
2121
Those marked with a star (⭐) were identified as having the greatest impact in Heather et al. 2025.
2222

23+
::: {.blue}
24+
25+
This book adopts the STARS reproducibility recommendations because they were developed from a study of real healthcare DES models and focus directly on computational reproducibility. They give a clear, healthcare-specific checklist for making DES studies easier to re-run, troubleshoot, and reuse, which this book follows throughout.
26+
27+
:::
28+
2329
### Recommendations to support reproduction
2430

2531
::: {.grey-table}

pages/guide/environment-full.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: des-rap-book
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- black=25.1.0
6+
- flake8=7.3.0
7+
- itables=2.5.2
8+
- jupyter=1.1.1
9+
- openssl=3.3.0
10+
- pandas=2.3.1
11+
- plotly=6.3.0
12+
- pip
13+
- pre-commit=4.3.0
14+
- pylint=3.3.7
15+
- pytest=8.4.1
16+
- python=3.11
17+
- ruff=0.12.7
18+
- simpy=4.1.1
19+
- pip:
20+
- ansi2html==1.9.2
21+
- distfit==1.8.8
22+
- jupytext==1.17.2
23+
- kaleido==1.1.0
24+
- lintquarto==0.5.0
25+
- sim-tools==1.0.0
26+
- -e .

pages/guide/experiments/full_run.qmd

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ date: "2025-10-03T15:54:56+01:00"
2323

2424
As introduced at the start of this book, a **reproducible analytical pipeline (RAP)** is a systematic approach to data analysis and modelling in which every step of the process (end-to-end) is transparent, automated, and repeatable.
2525

26-
![](../intro/rap_resources/rap.png)
26+
![](/pages/intros/rap_resources/rap.png)
2727

2828
A key aspect RAPs is being able to **run your entire analysis from start to finish with a single command**. For example, one command that can run a simulation model, evaluate the base case, explore scenarios, conduct sensitivity analyses, and produce all tables and figures.
2929

@@ -59,6 +59,34 @@ In this example, we'll **focus on a bash script**, since it's often the simplest
5959

6060
<div class="h3-tight"></div>
6161

62+
### What are bash scripts?
63+
64+
A bash script is a plain text file that contains a list of terminal commands, written for the Bash shell, that are executed in order from top to bottom. Instead of typing each command manually, you save them in a `.sh` file and run the script to perform the whole sequence with a single command
65+
66+
### Where to put the script?
67+
68+
Save the script below as `run_notebooks.sh` in the root of your project, alongside the `notebooks/` folder.
69+
70+
::: {.python-content}
71+
72+
This allows the script to loop over `rmarkdown/*.Rmd` without extra path adjustments.
73+
74+
:::
75+
76+
::: {.r-content}
77+
78+
This allows the script to loop over `notebooks/*.ipynb` without extra path adjustments.
79+
80+
:::
81+
82+
### Which terminal to use?
83+
84+
This script is written for Bash.
85+
86+
**Linux** or **macOS** users can just use their normal terminal (which runs Bash or a compatible shell).
87+
88+
On Windows, you'll need to run it from a bash-compatible terminal like **Git Bash**. PowerShell and Command Prompt use different syntax and cannot run `.sh` bash scripts directly.
89+
6290
### Example script
6391

6492
::: {.python-content}
@@ -95,7 +123,7 @@ else
95123
fi
96124
```
97125

98-
### Explaining the bash script line by line
126+
#### Explaining the bash script line by line
99127

100128
```{.bash}
101129
#!/usr/bin/env bash
@@ -243,7 +271,19 @@ If a notebook name is given as a command-line argument, it only runs that notebo
243271

244272
### Running the bash script
245273

246-
Make sure you are in the same directory as the script, then run from the terminal:
274+
Make sure your terminal is in the project folder (i.e., the place where `run_notebooks.sh` is).
275+
276+
```{.bash}
277+
# Check where you are
278+
pwd
279+
280+
# List files; you should see run_notebooks.sh and notebooks/
281+
ls
282+
```
283+
284+
If you are not in the correct folder, use `cd path/to/your/project`.
285+
286+
To run the script without making it executable:
247287

248288
```{.bash}
249289
bash run_notebooks.sh
@@ -255,7 +295,7 @@ To run a specific notebook:
255295
bash run_notebooks.sh notebooks/notebook_name.ipynb
256296
```
257297

258-
You can make it executable using `chmod +x`. You can then run it directly (without typing `bash` first) from anywhere in your project folder tree (i.e., don't need to be in same directly).
298+
You can make it executable using `chmod +x`. This means you can then run it directly (without typing `bash` first) from anywhere in your project folder tree (i.e., don't need to be in same directly).
259299

260300
```{.bash}
261301
chmod +x run_notebooks.sh

pages/guide/experiments/scenarios.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This page continues on from: [Parallel processing](../output_analysis/parallel.q
3838

3939
**Required packages:**
4040

41-
These should be available from environment setup in the "Test yourself" section of [Environments](../setup/environment.qmd).
41+
These should be available from environment setup on the [Structuring as a package](/pages/guide/setup/package.qmd) page.
4242

4343
::: {.python-content}
4444

@@ -438,7 +438,7 @@ Scenario analysis focuses on a set of pre-defined situations which are plausible
438438

439439
Sensitivity analysis varies one parameter (or a small group of parameters) and assess the impact of small changes in that parameter on outcomes. The purpose is to understand **how uncertainty in the inputs affects the model**, and how **robust** the model is to variation in those inputs.
440440

441-
Sensitivity analysis is an important for model validation (and forms part of "[experimentation validation](../verification_validation/verification_validation.qmd#experimentation-validation)").
441+
Sensitivity analysis is an important technique for model validation (and forms part of "[experimentation validation](../verification_validation/verification_validation.qmd#experimentation-validation)").
442442

443443
### Running sensitivity analyses
444444

pages/guide/experiments/tables_figures.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This page uses the results saved on the [Scenario and sensitivity analysis](scen
3434

3535
**Required packages:**
3636

37-
These should be available from environment setup in the "Test yourself" section of [Environments](../setup/environment.qmd).
37+
These should be available from environment setup on the [Structuring as a package](/pages/guide/setup/package.qmd) page.
3838

3939
::: {.python-content}
4040

0 commit comments

Comments
 (0)