Skip to content

Commit

Permalink
make tolerance for pmfs configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitejohnson committed Sep 27, 2024
1 parent dd9a9a4 commit 097943c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/validate.R
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,15 @@ validate_both_datasets <- function(input_count_data,
#' @param calibration_time integer indicating the calibration time
#' @param count_data tibble containing the input count data ready to be passed
#' to stan
#' @param tolerance numeric indicating the allowable difference between the
#' sum of the pmf and 1, default is `1e-6`
#' @param arg name of the argument supplying the object
#' @param call The calling environment to be reflected in the error message
#' @return NULL, invisibly
validate_pmf <- function(pmf,
calibration_time,
count_data,
tolerance = 1e-6,
arg = "x",
call = rlang::caller_env()) {
if (!isTRUE(all.equal(sum(pmf), 1, tolerance = 1e-6))) {
Expand Down
4 changes: 4 additions & 0 deletions man/validate_pmf.Rd

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

0 comments on commit 097943c

Please sign in to comment.