-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to README, reproduction and report
- Loading branch information
1 parent
13212f4
commit 63a887d
Showing
3 changed files
with
118 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,95 @@ | ||
# COVID-19 Dialysis Service Delivery Model | ||
|
||
**Article:** Allen, M., Bhanji, A., Willemsen, J., Dudfield, S., Logan, S., & Monks, T. **A simulation modelling toolkit for organising outpatient dialysis services during the COVID-19 pandemic**. *PLoS One* 15, 8 (2020). <https://doi.org/10.1371%2Fjournal.pone.0237628>. | ||
## Model summary | ||
|
||
**Source code:** <https://zenodo.org/records/3760626>. | ||
Allen, M., Bhanji, A., Willemsen, J., Dudfield, S., Logan, S., & Monks, T. A simulation modelling toolkit for organising outpatient dialysis services during the COVID-19 pandemic. *PLoS One* 15, 8 (2020). <https://doi.org/10.1371%2Fjournal.pone.0237628>. | ||
|
||
**Plain english summary:** | ||
This is a discrete-event simulation modeling patient allocation to dialysis units during the pandemic. The patients need to be transported to a dialysis unit several times a week but, during the pandemic, it was required that COVID positive patients were kept seperate from COVID negative patients. The proposed plan was that all COVID negative units were sent to a particular unit (with a second overflow unit). This study tests that plan with a worst-case scenario of COVID spread over 150 days. | ||
|
||
**Model scope:** | ||
Model patient pathway figure from the original study: | ||
|
||
**Reproduction specs:** | ||
![Patient pathway figure](../original_study/article_fig1.png) | ||
|
||
## Steps to reproduce results | ||
## Scope of the reproduction | ||
|
||
### Part 1. Set up environment | ||
In this assessment, we attempted to reproduced three figures. | ||
|
||
There are two options: using conda to install the provided virtual environment on your local machine, or using a docker image containing all the code and the virtual environment. | ||
![Figure 2. "Patient state over time by unit. The patient population progresses through infection over three months (with 80% infected). The bold line shows the median results of 30 trials, and the fainter lines show the minimum and maximum from the 30 trials."](../original_study/article_fig2.png){width=50%} | ||
|
||
**Conda environment:** To use the provided conda environment, run the following in a terminal | ||
![Figure 3. "Progression of patient population through COVID infection, assuming 80% become infected over three months, with 15% mortality. The figure also shows the number of patients not allocated to a dialysis session at any time. The bold line shows the median results of 30 trials, and the fainter lines show the minimum and maximum from the 30 trials."](../original_study/article_fig3.png){width=50%} | ||
|
||
``` | ||
conda env create -f environment.yaml | ||
``` | ||
![Figure 4. "Patient displacement. The number of patients displaced from their current unit (left panel) and the additional travel time to the unit of care (right panel) for displaced patients. These results do not include those receiving inpatient care. The patient population progresses through infection over three months (with 80% infected). The bold line shows the median results of 30 trials, and the fainter lines show the minimum and maximum from the 30 trials."](../original_study/article_fig4.png){width=50%} | ||
|
||
You can use this environment in your preferred IDE, such as VSCode. To use the browser-based JupyterLab, run the following: | ||
## Reproducing these results | ||
|
||
``` | ||
conda activate covid19 | ||
jupyter-lab | ||
### Repository overview | ||
|
||
```bash | ||
├── data | ||
│ └── ... | ||
├── docker | ||
│ └── ... | ||
├── output | ||
│ └── ... | ||
├── sim | ||
│ └── ... | ||
├── tests | ||
│ └── ... | ||
├── environment.yaml | ||
├── README.md | ||
└── reproduction.ipynb | ||
``` | ||
|
||
**Docker:** To use the Docker image, you will need `docker` installed on your local machine. You can then obtain the image by either: | ||
* `data/` - Data input to the model. | ||
* `docker/` - Instructions for creation of Docker container. | ||
* `output/` - Output files from the model. | ||
* `sim/` - Model code. | ||
* `tests/` - Test to check that model produces consistent results with our reproduction. | ||
* `environment.yaml` - Instructions for creation of Conda environment. | ||
* `README.md` - This file! | ||
* `reproduction.ipynb` - Notebook which runs model and reproduces items from scope. | ||
|
||
* Pulling a pre-built image from the GitHub container registry by running `docker pull ghcr.io/pythonhealthdatascience/covid19:latest`, or | ||
* Building the image locally from the Dockerfile by running `docker build --tag covid19 .` | ||
### Step 1. Set up environment | ||
|
||
To run the image, you should then issue the following commands in your terminal: | ||
You'll first want create an environment with the specified version of Python and the required packages installed. There are a few options... | ||
|
||
``` | ||
docker run -it -p 8080:80 --name covid19_docker covid19 | ||
conda activate covid19 | ||
jupyter-lab | ||
``` | ||
Option A: **Conda environment** | ||
|
||
> Create the environment using this command in your terminal: `conda env create -f environment.yaml` | ||
> | ||
> You can use this environment in your preferred IDE, such as VSCode. To use the browser-based JupyterLab, activate it using `conda activate covid19`, and then open JupyterLab by running `jupyter-lab` | ||
Option B: **Docker** | ||
|
||
> You'll need `docker` installed on your local machine. You can then obtain the image by either: | ||
> | ||
> * Pulling a pre-built image from the GitHub container registry by running `docker pull ghcr.io/pythonhealthdatascience/covid19:latest`, or | ||
> * Building the image locally from the Dockerfile by running `docker build --tag covid19 .` | ||
> | ||
> To run the image, you should then issue the following commands in your terminal: | ||
> | ||
> * `docker run -it -p 8080:80 --name covid19_docker covid19` | ||
> * `conda activate covid19` | ||
> * `jupyter-lab` | ||
> | ||
> Then open your browser and go to <https://localhost:8080>. This will open Jupyterlab within the reproduction/ directory. | ||
### Step 2. Running the model | ||
|
||
To run the model and produce all three items from the scope, execute the notebook `reproduction.ipynb`. | ||
|
||
To check that your results are consistent with our reproduction, run the command `pytest` in your terminal. When doing so, ensure your current directory is the `reproduction/` folder. | ||
|
||
## Reproduction specs and runtime | ||
|
||
This reproduction was conducted on an Intel Core i7-12700H with 32GB RAM running Ubuntu 22.04.4 Linux. | ||
|
||
Expected model runtime (given these specs) is **1m 3s** (as recorded within the notebook). | ||
|
||
Then open your browser and go to <https://localhost:8080>. This will open Jupyterlab within the reproduction/ directory. | ||
## Citation | ||
|
||
### Part 2. Running the model | ||
To cite the original study, please refer to the reference above. To cite this reproduction, please refer to the CITATION.cff file in the parent folder. | ||
|
||
The three items in the scope are all produced by running `reproduction.ipynb`. | ||
## License | ||
|
||
Run `pytest` (make sure you current directory is the `reproduction/` folder) to check that model results from your run are as expected. | ||
This repository is licensed under the MIT License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters