-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.Rmd
78 lines (68 loc) · 2.02 KB
/
models.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
title: "Documentation of the participating modelling teams, their models and modelling assumptions"
output:
html_document:
self-contained: true
toc: true
toc_float:
collapsed: false
date: ""
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE
)
library(dplyr)
library(purrr)
library(stringr)
```
This page presents the various features and implementations in the models submitted to the Scenario Hub. To learn more about each model individually, please refer to the latest set of [models abstracts](https://github.com/covid19-forecast-hub-europe/covid19-scenario-hub-europe/tree/main/model-abstracts).
```{r}
github_repo <- "covid19-forecast-hub-europe/covid19-scenario-hub-europe"
branch <- "main"
metadata_files <- gh::gh(
"/repos/{github_repo}/git/trees/{branch}?recursive=1",
github_repo = github_repo, branch = branch
) |>
pluck("tree") |>
keep(~ .x$type == "blob" && grepl("model-metadata/", .x$path))
abstract_files <- gh::gh(
"/repos/{github_repo}/git/trees/{branch}?recursive=1",
github_repo = github_repo, branch = branch
) |>
pluck("tree") |>
keep(~ .x$type == "blob" && grepl("model-abstracts/", .x$path))
```
## Model summary
```{r}
metadata <- metadata_files |>
map_chr(~ glue::glue("https://raw.githubusercontent.com/{github_repo}/{branch}/{.x$path}")) |>
map(yaml::read_yaml)
names(metadata) <- purrr::map(metadata, "model_abbr")
```
```{r, results='asis'}
metadata |>
purrr::map_dfr(
~ list(
"Model" = .x["model_abbr"],
"Authors" = glue::glue_collapse(purrr::map(.x$model_contributors, "name"), sep = ", "),
"License" = .x["license"]
)
) |>
knitr::kable()
```
## Model details
```{r, results='asis'}
metadata |>
map("model_details") |>
compact() |>
transpose() |>
imap(function(model_details, feature) {
knitr::knit_child("_model_feature.Rmd", envir = environment())
}) |>
unlist() |>
knitr::knit_child(text = _, quiet = TRUE) |>
cat(sep = "\n")
```