Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitejohnson committed Feb 7, 2025
2 parents 8473f19 + 5d23bd5 commit 7b0df20
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codemeta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
body: "This is an automated pull request to update the codemeta.json file."
branch: "update-codemeta-${{ github.run_number }}"
labels: "metadata"
reviewers: seabbs
reviewers: kaitejohnson
add-paths: |
codemeta.json
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Description: Provides functions for nowcasting right-truncated epidemiological
data, based heavily on the method implemented in
https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline
License: MIT + file LICENSE
URL: https://github.com/epinowcast/baselinenowcast/
URL: https://baselinenowcast.epinowcast.org, https://github.com/epinowcast/baselinenowcast/
BugReports: https://github.com/epinowcast/baselinenowcast/issues
Depends:
R (>= 4.0.0)
R (>= 4.1.0)
Imports:
cli,
checkmate,
Expand All @@ -46,6 +46,8 @@ Suggests:
withr,
knitr
Encoding: UTF-8
Language: en-GB
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
VignetteBuilder: knitr
Expand Down
11 changes: 5 additions & 6 deletions R/apply_delay.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#' Apply the delay to generate a point nowcast
#' @description
#' Generate a point estimate of a completed reporting square (or rectangle)
#' from a reporting triangle that we want to complete with a nowcast and a
#' delay pmf. This code was adapted from code written (under an MIT license)
#' by the Karlsruhe Institute of Technology RESPINOW
#' German Hospitalization Nowcasting Hub.
#' Modified from: https://github.com/KITmetricslab/RESPINOW-Hub/blob/7cce3ae2728116e8c8cc0e4ab29074462c24650e/code/baseline/functions.R#L55 #nolint
#' from a reporting triangle that we want to complete with a nowcast and a
#' delay pmf. This code was adapted from code written (under an MIT license)
#' by the Karlsruhe Institute of Technology RESPINOW
#' German Hospitalization Nowcasting Hub.
#' Modified from: https://github.com/KITmetricslab/RESPINOW-Hub/blob/7cce3ae2728116e8c8cc0e4ab29074462c24650e/code/baseline/functions.R#L55 #nolint
#' @param triangle_to_nowcast Matrix of the incomplete reporting triangle to be
#' nowcasted, with rows representing the time points of reference and columns
#' representing the delays
Expand Down
23 changes: 11 additions & 12 deletions R/get_delay_estimate.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#' Estimate a delay distribution from a reporting triangle
#' @description
#' Provides an estimate of the reporting delay as a function
#' of the delay, based on the reporting triangle and the specified maximum
#' delay and number of reference date observations to be used in the
#' estimation. This point estimate of the delay is computed empirically,
#' using an iterative algorithm starting from the most recent observations.
#' This code was adapted from code written (under an MIT license)
#' by the Karlsruhe Institute of Technology RESPINOW
#' German Hospitalization Nowcasting Hub.
#' Modified from: https://github.com/KITmetricslab/RESPINOW-Hub/blob/7cce3ae2728116e8c8cc0e4ab29074462c24650e/code/baseline/functions.R#L55 #nolint
#' of the delay, based on the reporting triangle and the specified maximum
#' delay and number of reference date observations to be used in the
#' estimation. This point estimate of the delay is computed empirically,
#' using an iterative algorithm starting from the most recent observations.
#' This code was adapted from code written (under an MIT license)
#' by the Karlsruhe Institute of Technology RESPINOW
#' German Hospitalization Nowcasting Hub.
#' Modified from: https://github.com/KITmetricslab/RESPINOW-Hub/blob/7cce3ae2728116e8c8cc0e4ab29074462c24650e/code/baseline/functions.R#L55 #nolint
#' @param triangle Matrix of the reporting triangle, with rows representing
#' the time points of reference and columns representing the delays
#' the time points of reference and columns representing the delays
#' @param max_delay Integer indicating the maximum delay to estimate, in units
#' of the delay. The default is to use the whole reporting triangle,
#' `ncol(triangle) -1`.
#' of the delay. The default is to use the whole reporting triangle,
#' `ncol(triangle) -1`.
#' @param n_history Integer indicating the number of reference dates to be
#' used in the estimate of the reporting delay, always starting from the most
#' recent reporting delay. The default is to use the whole reporting triangle,
Expand Down
1 change: 0 additions & 1 deletion R/handle_neg_vals.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' Handle negative values in the reporting triangle
#' @description
#' Takes in a reporting triangle and returns a matrix in the same format
#' as the input triangle, but with negative values of reporting handled via
#' passing them to the subsequent days (from longer delay to shorter).
Expand Down
2 changes: 0 additions & 2 deletions R/validate.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' Validate triangle
#' @description
#' Various checks to make sure that the reporting triangle passed in to
#' [get_delay_estimate()] is formatted properly.
#' @importFrom checkmate assert_class
Expand Down Expand Up @@ -57,7 +56,6 @@
}

#' Validate triangle to nowcast and delay pmf together
#' @description
#' Various checks to make sure that the reporting triangle and the delay pmf
#' passed in to [apply_delay()] are formatted properly and compatible
#' @param triangle Matrix of values with rows indicating the time points and
Expand Down
5 changes: 4 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url: https://baselinenowcast.epinowcast.org/
template:
pacakge: enwtheme
package: enwtheme
math-rendering: mathjax


Expand All @@ -9,8 +9,11 @@ development:

navbar:
structure:
left: [intro, metareference, news]
right: [search, github, lightswitch]
components:
metareference:
text: Reference

home:
title: Baseline nowcast for right-truncated epidemiological data
36 changes: 27 additions & 9 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"identifier": "baselinenowcast",
"description": "Provides functions for nowcasting right-truncated epidemiological data, based heavily on the method implemented in https://github.com/KITmetricslab/RESPINOW-Hub/tree/main/code/baseline",
"name": "baselinenowcast: Baseline nowcast",
"relatedLink": "https://baselinenowcast.epinowcast.org",
"codeRepository": "https://github.com/epinowcast/baselinenowcast/",
"issueTracker": "https://github.com/epinowcast/baselinenowcast/issues",
"license": "https://spdx.org/licenses/MIT",
Expand Down Expand Up @@ -65,27 +66,32 @@
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
"identifier": "epinowcast",
"name": "epinowcast"
},
{
"@type": "SoftwareApplication",
"identifier": "bookdown",
"name": "bookdown",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
"sameAs": "https://CRAN.R-project.org/package=bookdown"
},
{
"@type": "SoftwareApplication",
"identifier": "bookdown",
"name": "bookdown",
"identifier": "dplyr",
"name": "dplyr",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=bookdown"
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
{
"@type": "SoftwareApplication",
Expand Down Expand Up @@ -178,13 +184,25 @@
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 4.0.0"
"version": ">= 4.1.0"
},
"2": {
"@type": "SoftwareApplication",
"identifier": "cli",
"name": "cli",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=cli"
},
"SystemRequirements": null
},
"fileSize": "4.575KB",
"fileSize": "33.639KB",
"releaseNotes": "https://github.com/epinowcast/baselinenowcast/blob/master/NEWS.md",
"readme": "https://github.com/epinowcast/baselinenowcast/blob/main/README.Rmd",
"readme": "https://github.com/epinowcast/baselinenowcast/blob/main/README.md",
"contIntegration": ["https://github.com/epinowcast/baselinenowcast/actions/workflows/R-CMD-check.yaml", "https://app.codecov.io/gh/epinowcast/baselinenowcast"],
"developmentStatus": "https://lifecycle.r-lib.org/articles/stages.html#stable"
}
9 changes: 8 additions & 1 deletion man/apply_delay.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion man/dot-handle_neg_vals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/dot-validate_delay_and_triangle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/dot-validate_triangle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion man/get_delay_estimate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b0df20

Please sign in to comment.