Skip to content

Commit

Permalink
Merge branch 'main' into linters
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte authored Dec 21, 2023
2 parents 13c0538 + 8517a83 commit 0aac314
Show file tree
Hide file tree
Showing 23 changed files with 3,967 additions and 12 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
.lintr
^cran-comments\.md$
^README\.Rmd$
^data-raw$
.vscode
32 changes: 32 additions & 0 deletions .github/sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ssi-dk/diseasystore:
- .github/workflows/synchronise-files.yaml
- .github/sync.yaml

- R/0_linters.R
- tests/testthat/test-0_linters.R

- R/0_R6_utils.R
- tests/testthat/test-0_R6_utils.R

- R/0_documentation.R
- tests/testthat/test-0_documentation.R

- tests/testthat/test-0_return.R
- tests/testthat/test-0_examples.R


ssi-dk/diseasy:
- .github/workflows/synchronise-files.yaml
- .github/sync.yaml

- R/0_linters.R
- tests/testthat/test-0_linters.R

- R/0_R6_utils.R
- tests/testthat/test-0_R6_utils.R

- R/0_documentation.R
- tests/testthat/test-0_documentation.R

- tests/testthat/test-0_return.R
- tests/testthat/test-0_examples.R
21 changes: 21 additions & 0 deletions .github/workflows/synchronise-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
branches:
- main
workflow_dispatch:

jobs:
sync:
name: 🔄 Sync diseasyverse files
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Run GitHub File Sync
uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.GH_PAT }}
CONFIG_PATH: .github/sync.yaml
COMMIT_PREFIX: "chore: "
PR_BODY: Automatically synchronise files between diseasyverse repositories
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Language: en-GB
LazyData: TRUE
Depends:
diseasystore
diseasystore,
R (>= 3.5.0)
Imports:
checkmate,
digest,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

export("%.%")
export(DiseasyActivity)
export(DiseasyBaseModule)
export(DiseasyObservables)
export(DiseasySeason)
Expand Down
39 changes: 39 additions & 0 deletions R/0_documentation.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
rd_activity_units <- function(type = "param") {
checkmate::assert_choice(type, c("param", "field"))
paste("(`list(list())`)\\cr",
"A nested list of all possible 'units' of activity that can be opened or closed.",
ifelse(type == "field", " Read only.", ""))
}


rd_stratification <- function(type = "param") {
checkmate::assert_choice(type, c("param", "field"))
paste("(`list`(`quosures`))\\cr",
Expand All @@ -15,6 +23,22 @@ rd_diseasystore <- function(type = "param") {
}


rd_contact_basis <- function(type = "param") {
checkmate::assert_choice(type, c("param", "field"))
paste("(`list(list())`)\\cr",
"A nested list with all the needed information for the contact_basis\\cr",
"* `counts` contains the age stratified contact counts across the arenas of the basis",
" (e.g. 'work', 'home', 'school', 'other')\\cr",
"* `proportion` contains a list of the proportion of population in each age-group\\cr",
"* `demography` contains a `data.frame` with the columns\\cr",
" * `age` (`integer()`) 1-year age group\\cr",
" * `population` (`numeric()`) size of population in age group\\cr",
" * `proportion` (`numeric()`) proportion of total population in age group\\cr",
"* `description` contains information about the source of the contact basis.",
ifelse(type == "field", " Read only.", ""))
}


rd_observable <- function(type = "param") {
checkmate::assert_choice(type, c("param", "field"))
paste("(`character`)\\cr",
Expand Down Expand Up @@ -154,3 +178,18 @@ rd_training_length <- paste(
"(`numeric`)\\cr",
"The number of days that should be included in the training of the model."
)


rd_side_effects <- "NULL (called for side effects)"



rd_age_cuts_lower <- paste(
"(`numeric`)\\cr",
"vector of ages defining the lower bound for each age group. If NULL (default), age groups of contact_basis is used."
)

rd_activity_weights <- paste(
"(`numeric(4)`)\\cr",
"vector of weights for the four types of contacts. If NULL (default), no weighting is done."
)
Loading

0 comments on commit 0aac314

Please sign in to comment.