Skip to content

Commit 2955910

Browse files
authored
Merge pull request #191 from pythonhealthdatascience/dev
Dev
2 parents 996652f + a877aed commit 2955910

19 files changed

Lines changed: 280 additions & 199 deletions

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ 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.5.0 - 2026-02-20
9+
10+
This release has lots and lots of changes based on peer review of the book from Nav Mustafee, Rob Challen, Tom Slater and Alison Harper. Other changes include addressing FAIRness requirements, switching R length of warm-up analysis to use intervals, and improving the docker action used to build the site.
11+
12+
### Added
13+
14+
* Addressed FAIRness requirements ([#170](https://github.com/pythonhealthdatascience/des_rap_book/issues/170)), with some larger changes including:
15+
* Addition of action which checks all images have alt text.
16+
* New "Impact" page.
17+
18+
### Changed
19+
20+
* R length of warm-up now uses intervals.
21+
* Improved `docker_quarto.yaml` (shorter run-time as doesn't need to restore renv every time build book).
22+
* Addressed peer review feedback from Nav Mustafee ([#149](https://github.com/pythonhealthdatascience/des_rap_book/issues/149), [#150](https://github.com/pythonhealthdatascience/des_rap_book/issues/150), [#158](https://github.com/pythonhealthdatascience/des_rap_book/issues/158), and [#161](https://github.com/pythonhealthdatascience/des_rap_book/issues/161)).
23+
* Addressed peer review feedback from Rob Challen ([#152](https://github.com/pythonhealthdatascience/des_rap_book/issues/152) and sub-issues).
24+
* Addressed peer review feedback from Tom Slater ([#172](https://github.com/pythonhealthdatascience/des_rap_book/issues/172) and sub-issues).
25+
* Addressed peer review feedback from Alison Harper ([#169](https://github.com/pythonhealthdatascience/des_rap_book/issues/169) and sub-issues).
26+
* Add all-contributors CLI instructions to `CONTRIBUTING.md`.
27+
828
## v0.4.0 - 2026-01-06
929

1030
### Added
@@ -129,4 +149,4 @@ This release adds a large number of new pages. It also introduces pre-commits, c
129149
* Model building section covering:
130150
* Randomness
131151
* Entity generation
132-
* Entity processing
152+
* Entity processing

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ keywords:
5353
- simmer
5454
- rap
5555
license: MIT
56-
version: '0.4.0'
57-
date-released: '2026-01-06'
56+
version: '0.5.0'
57+
date-released: '2026-02-20'

pages/guide/environment-full.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- flake8=7.3.0
77
- itables=2.5.2
88
- jupyter=1.1.1
9-
- nbconvert-core=7.16.6
9+
- nbconvert=7.17.0
1010
- openssl=3.3.0
1111
- pandas=2.3.1
1212
- plotly=6.3.0

pages/guide/further_info/conclusion.qmd

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ title: Conclusion
33
date: "2025-11-05T11:44:20+00:00"
44
---
55

6-
<!-- Hide as no python-content or r-content blocks -->
7-
<style>
8-
#quarto-announcement {
9-
display: none !important;
10-
}
11-
</style>
12-
136
<br>
147

158
::: {.pale-blue}
@@ -32,16 +25,32 @@ Remember, these are **examples**, not prescriptions. They're not perfect, and th
3225

3326
**Nurse visit simulation:**
3427

28+
::: {.python-content}
29+
3530
{{< include /html/pydesrapmms.html >}}
3631

32+
:::
33+
34+
::: {.r-content}
35+
3736
{{< include /html/rdesrapmms.html >}}
3837

38+
:::
39+
3940
**Stroke pathway simulation:**
4041

42+
::: {.python-content}
43+
4144
{{< include /html/pydesrapstroke.html >}}
4245

46+
:::
47+
48+
::: {.r-content}
49+
4350
{{< include /html/rdesrapstroke.html >}}
4451

52+
:::
53+
4554
### Make your own model
4655

4756
The best way to solidify what you've learned is to apply it. When planning your model, remember that a good simulation starts with **conceptual modelling**. As defined in Robinson (2007):

pages/guide/output_analysis/length_warmup.qmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,6 @@ If you've already built warm-up logic into your model (as we have done), make su
10211021

10221022
As mentioned above, we have used multiple replications and a long run length. This run length is based on the assumption that our desired simulation run length is 10 days (14400 minutes).
10231023

1024-
> So far, the model we have been constructing in this book has intentionally had a short duration. This is handy when developing - for example, for looking over the log messages. However, this is unrealistic of an actual simulation of a healthcare system, and will produce great variability (requiring very long warm-up / large number of replications for stable results). From this point onwards, we increase the run time as mentioned.
1025-
10261024
```{r}
10271025
#| warning: false
10281026
@@ -1079,11 +1077,11 @@ ggplotly(plots[[5L]])
10791077

10801078
::::
10811079

1082-
The selection of a warm-up period is **subjective**. The dotted red line shows our suggestion, but this choice could be changed subject to discussion and evaluation of other metrics.
1080+
The selection of a warm-up period is **subjective**. The dotted red line shows our suggestion, but in practice, there is usually a range of sensible warm-up values that give very similar results, and small changes within a reasonable range will often only have a small effect on results, as long as the total run length is long enough.
10831081

10841082
::: {.callout-note}
10851083

1086-
In this example, we assumed a total run length of 10 days (14400 minutes) to illustrate how to determine an appropriate warm-up period. However, for the remainder of this book, we will return to using shorter parameters (i.e., 30 minute warm-up, 40 minute data collection period, 5 replications) to keep examples simple, quick to run, and easy to follow.
1084+
In this example, we assumed a total run length of 10 days (14400 minutes) to illustrate how to determine an appropriate warm-up period. Short model runs, like those we've used so far, are useful during development (e.g., when inspecting log messages), but they produce high variability and are unrealistic of an actual healthcare system. However, for the remainder of this book, we will return to using shorter parameters (i.e., 30 minute warm-up, 40 minute data collection period, 5 replications) to keep examples simple, quick to run, and easy to follow.
10871085

10881086
:::
10891087

pages/guide/output_analysis/n_reps.qmd

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ This page continues on from: [Replications](replications.qmd).
3131

3232
The following imports are required. These should be available from environment setup on the [Structuring as a package](/pages/guide/setup/package.qmd) page.
3333

34-
Since [Replications](replications.qmd), we have several new imports: functions from `typing` and from `sim_tools.output_analysis`.
35-
3634
::: {.python-content}
3735

36+
Since [Replications](replications.qmd), we have several new imports: functions from `typing` and from `sim_tools.output_analysis`.
37+
3838
```{python}
3939
# For display purposes:
4040
from IPython.display import HTML
@@ -181,7 +181,7 @@ The `desired_precision` parameter is set to 0.1, which means we are interested i
181181

182182
::: {.callout-note title="Stopping condition: `desired_precision` and confidence intervals"}
183183

184-
We construct a confidence interval for each performance measure at a chosen confidence level (typically 95%). The interval has a half‑width, which is the margin of error around the estimated mean. The `desired_precision` parameter sets how small this half‑width must be relative to the mean (for example, 0.1 means within 10% of the mean).
184+
We construct a confidence interval for each performance measure at a chosen confidence level (typically 95%). The interval has a half‑width, which is the margin of error around the estimated mean. The `desired_precision` parameter sets how small this half‑width must be relative to the mean (for example, 0.1 means "within 10% of the mean").
185185

186186
The confidence interval method keeps increasing the number of replications until this relative half‑width falls below `desired_precision` (and is above `min_rep`), indicating that additional replications are unlikely to change the estimate by more than the chosen percentage.
187187

@@ -508,6 +508,20 @@ plot_replication_ci <- function(
508508

509509
:::
510510

511+
`confidence_interval_method()` runs the model for the specified number of replications, and after each replication it updates a single row that summarises what we know so far about the chosen performance measure. It records the most recent value of the metric, the running average across all completed replications, the standard deviation, and the 95% confidence interval around that average (lower and upper bounds). From this interval it also calculates a relative "half‑width" (how far the upper confidence limit is above the mean, as a proportion of the mean), which is compared to desired_precision to decide when you have run enough replications. The function returns a data frame containing this full sequence of per‑replication summaries, and prints a message when the desired precision is first achieved.
512+
513+
We supply `confidence_interval_method` with three main inputs: the parameters, the performance measure to analyse, and the `desired_precision`. The `desired_precision` parameter is set to 0.1, which means we are interested in identifying when the percentage deviation of the confidence interval from the mean falls **below 10%**.
514+
515+
::: {.callout-note title="Stopping condition: `desired_precision` and confidence intervals"}
516+
517+
We construct a confidence interval for each performance measure at a chosen confidence level (typically 95%). The interval has a half‑width, which is the margin of error around the estimated mean. The `desired_precision` parameter sets how small this half‑width must be relative to the mean (for example, 0.1 means "within 10% of the mean").
518+
519+
The confidence interval method keeps increasing the number of replications until this relative half‑width falls below `desired_precision`, indicating that additional replications are unlikely to change the estimate by more than the chosen percentage.
520+
521+
**Note:** The 10% threshold used is our default, but is relatively arbitrary. We are just using it to help us identify the point where results are stable enough.
522+
523+
:::
524+
511525
```{r}
512526
metrics <- c("mean_wait_time_doctor", "utilisation_doctor",
513527
"mean_queue_length_doctor", "mean_time_in_system",
@@ -526,6 +540,8 @@ for (m in metrics) {
526540
}
527541
```
528542

543+
`plot_replication_ci()` then takes that data frame and produces a plot showing how the cumulative mean and its confidence interval change as you add more replications, optionally marking the recommended number of replications with a vertical dashed line so you can visually check that the estimates have stabilised.
544+
529545
Click the name of each metric below to view the relevant plot:
530546

531547
::: {.panel-tabset}
@@ -1451,7 +1467,11 @@ res <- run_replications_algorithm(
14511467
14521468
# View recommended number of replications
14531469
res$nreps
1470+
```
14541471

1472+
The algorithm returns the minimum number of replications required for each performance measure to reach the desired precision. In this example, the largest of these values is 19 (for `mean_queue_length_doctor`), so we would use approximately 19 replications for this model overall, to ensure all performance measures meet the target precision.
1473+
1474+
```{r}
14551475
# View full results table
14561476
res$summary_table |>
14571477
kable() |>

pages/guide/sharing/archive.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Whilst platforms like GitHub are great for sharing code, they provide no guarant
137137

138138
Open science archives will **provide long-term storage guarantees** ensuring future access to your work. They will create a **digital object identifier (DOI)** (a persistent identifier for your code).
139139

140-
Archives should adhere to recognised principles like [TRUST (Transparency, Responsibility, User focus, Sustainability, and Technology)](https://doi.org/10.1038/s41597-020-0486-7) and the [FORCE11 standards](https://doi.org/10.7717/peerj-cs.86)
140+
Archives should adhere to recognised principles like [TRUST (Transparency, Responsibility, User focus, Sustainability, and Technology)](https://doi.org/10.1038/s41597-020-0486-7) and the [FORCE11 (Future of Research Communications and E-Scholarship) standards](https://doi.org/10.7717/peerj-cs.86)
141141

142142
Archives can be generalist (for any research discipline), subject-specific, or institutional (hosted by a particular university or research institute). Examples include:
143143

pages/guide/sharing/citation.qmd

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ This page explains why and how to provide citation instructions in your simulati
4949

5050
> Explicitly list and acknowledge everyone who played a role in the project (including minor contributions). There are structured frameworks which can be used to specify roles, like the [Contributor Role Taxonomy (CRediT)](https://credit.niso.org/) for research projects.
5151
52-
For `CITATION.cff` files...
52+
<br>
53+
54+
Many repositories use a CITATION.cff file to store structured citation metadata for software and datasets. This plain-text file is both human- and machine-readable and is supported by tools like GitHub, Zenodo, and Zotero. For repositories using `CITATION.cff` files, additional benefits are that it is...
5355

5456
**Used when archiving**
5557

@@ -65,7 +67,7 @@ For `CITATION.cff` files...
6567

6668
### `CITATION.cff`
6769

68-
A `CITATION.cff` file is a plain text file with a standard structure to share citation metadata for software or datasets.
70+
As mentioned above, a `CITATION.cff` file is a plain text file with a standard structure to share citation metadata for software or datasets.
6971

7072
The easiest way to create this file is using the [cffinit](https://citation-file-format.github.io/cff-initializer-javascript/#/) web application. It will guide you through the required information, and generate a `CITATION.cff` file at the end.
7173

@@ -85,9 +87,15 @@ As an example, the `CITATION.cff` from the repository for this book:
8587

8688
* **Zotero:** The Zotero reference manager uses `CITATION.cff` when importing the repository as a reference.
8789

88-
* **GitHub:** Adds a "Cite this repository" button to the sidebar, which provides APA and BibTeX citations (based on the `CITATION.cff` file), and links to the file. For example:
90+
* **GitHub:** Adds a "Cite this repository" button to the sidebar, which provides APA and BibTeX citations (based on the `CITATION.cff` file), and links to the file.
91+
92+
::: {.callout-tip title="Why Zenodo and Zotero matter for your model"}
93+
94+
**Zenodo:** Archiving a release of your GitHub repo on Zenodo gives your software a DOI, and Zenodo can read your `CITATION.cff` to auto‑populate title, authors, and version. This means others can cite the exact version of your model reproducibly.
95+
96+
**Zotero:** Many collaborators and reviewers manage references in Zotero. Having a DOI and structured metadata (via `CITATION.cff` or Zenodo) lets them add your software to their library and cite it like a paper or dataset.
8997

90-
![](citation_resources/cff_github.png){fig-alt="Screenshot of GitHub 'Cite this repository'."}
98+
:::
9199

92100
### `README.md`
93101

@@ -120,11 +128,11 @@ Heather, A., Monks, T., Mustafee, N., Harper, A., Alidoost, F., Challen, R., & S
120128
If you have [structured your model as a package](../setup/package.qmd), then you can include some citation instructions within the package.
121129

122130
:::{.python-content}
123-
Depending on your package manager, you can include citation and author details in several ways...
131+
Depending on your package manager, you can include citation and author details in several ways. A package manager is a tool that helps you build, install, and share your Python project as a package; it usually reads project metadata from a configuration file called `pyproject.toml`. This file can store information such as the package name, version, and authors, which users and tools can then use when citing your work.
124132

125133
<br>
126134

127-
**Flit:** Our tutorial used this as it is a very basic minimalist package manager. It had `__init.py` and `pyproject.toml` files. We can amend the `pyproject.toml` to add some citation information as follows:
135+
**Flit:** Our tutorial used Flit, a minimalist package manager that keeps configuration in a `pyproject.toml` file. You can add basic citation information (such as your name and email) to the `[project]` section so it is recorded as part of the package metadata:
128136

129137
```{.bash}
130138
[build-system]
@@ -141,7 +149,7 @@ authors = [
141149

142150
<br>
143151

144-
**Poetry:** Another popular manager, this has project details within `pyproject.toml` like so:
152+
**Poetry:** Poetry is another popular tool for managing dependencies and packaging, which also uses `pyproject.toml` to store project details. Here, citation‑related information like the package name, version, and authors is defined under the `[tool.poetry]` section:
145153

146154
```{.bash}
147155
[tool.poetry]
@@ -150,6 +158,11 @@ version = "0.1.0"
150158
authors = ["First Last <firstname.lastname@example.com>"]
151159
readme = "README.md"
152160
```
161+
162+
<br>
163+
164+
Other tools follow the same idea, but the exact section and format depend on the package manager you use.
165+
153166
:::
154167

155168
:::{.r-content}

0 commit comments

Comments
 (0)