README.md 2.37 KB
Newer Older
Chris Jewell's avatar
Chris Jewell committed
1
# Lancaster Stochastic SEIR COVID model pipeline
Chris Jewell's avatar
Chris Jewell committed
2

Chris Jewell's avatar
Chris Jewell committed
3
4
This repository contains pipeline code to run the [Lancaster University
Bayesian stochastic SEIR COVID19 model for the UK](https://github.com/chrism0dwk/covid19uk).
Chris Jewell's avatar
Chris Jewell committed
5

Chris Jewell's avatar
Chris Jewell committed
6
7
8
9
## Running the Docker container

The recommended method of running the pipeline is as a Docker container which may be bound to a local results directory, local config file, and optionally takes a `--date-range` parameter.  

Chris Jewell's avatar
Chris Jewell committed
10
For example, to run pipeline version `v0.1.1-alpha.4` over an 84 day time period ending 3 days ago, and saving results to a local directory `/local_results` use:
Chris Jewell's avatar
Chris Jewell committed
11
12
13

```
$ docker run --rm \
Chris Jewell's avatar
Chris Jewell committed
14
    -v /local_results:/results chrism0dwk/lancs-covid-bayesstm:0.1.1-alpha.4 \
Chris Jewell's avatar
Chris Jewell committed
15
16
17
18
19
20
21
22
    --date-range `date -d "-87 days" +%F` `date -d "-3 days" +%F` 
```

The latest version of the pipeline may be determined from the [Dockerhub](https://hub.docker.com/repository/docker/chrism0dwk/lancs-covid-bayesstm) repository.

The default `config.yaml` file is set up to configure the MCMC for an approximate 84 day window.  However, the file may be edited and supplied to the container like so:
```
$ docker run --rm \
Chris Jewell's avatar
Chris Jewell committed
23
    -v /local_results:/results chrism0dwk/lancs-covid-bayesstm:0.1.1-alpha.4 \
Chris Jewell's avatar
Chris Jewell committed
24
25
    -v /absolute/path/to/config.yaml:/app/config.yaml \
	--date-range `date -d "-87 days" +%F` `date -d "-3 days" +%F` 
Chris Jewell's avatar
Chris Jewell committed
26
27
```

Chris Jewell's avatar
Chris Jewell committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
__Note__: The Monte Carlo algorithms run by the pipeline are computationally intensive.  Using an 84 day time window and an NVIDIA Tesla V100 GPU accelerator card, expect approximately 11 hours runtime.

## Running the pipeline from the source repository

The pipeline may, for development purposes, be run from the source repository.  The pipeline requires [Poetry](https://python-poetry.org) and optionally a CUDA installation for GPU use (very much recommended!).

Once Poetry (and CUDA) is installed, package dependencies may be installed via poetry. 

```
$ git clone https://github.com/chrism0dwk/covid-pipeline.git
$ cd covid-pipeline
$ poetry install
```

To run the pipeline
```
$ poetry run python -m covid_pipeline.pipeline \
    --config config.yaml \
	--results-directory /path/to/results/directory \
	--date-range  `date -d "-87 days" +%F` `date -d "-3 days" +%F`
```

__Note__: The Monte Carlo algorithms run by the pipeline are computationally intensive.  Using an 84 day time window and an NVIDIA Tesla V100 GPU accelerator card, expect approximately 11 hours runtime.