Skip to content

Commit

Permalink
warn of behaviour change
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Oct 6, 2023
1 parent 1804556 commit 894ce6d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ importFrom(purrr,transpose)
importFrom(purrr,walk)
importFrom(rlang,abort)
importFrom(rlang,cnd_muffle)
importFrom(rlang,warn)
importFrom(rstan,expose_stan_functions)
importFrom(rstan,extract)
importFrom(rstan,sampling)
Expand Down
13 changes: 13 additions & 0 deletions R/dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ tune_inv_gamma <- function(lower = 2, upper = 21) {
#'
#' @author Sebastian Funk
#' @author Sam Abbott
#' @importFrom rlang warn
#' @export
#' @examples
#' # A fixed lognormal distribution with mean 5 and sd 1.
Expand All @@ -905,6 +906,18 @@ tune_inv_gamma <- function(lower = 2, upper = 21) {
dist_spec <- function(mean, sd = 0, mean_sd = 0, sd_sd = 0,
distribution = c("lognormal", "gamma"), max,
pmf = numeric(0), fixed = FALSE) {
## deprecate previous behaviour
warn(
message = paste(
"The meaning of the 'max' argument has changed compared to",
"previous versions. It now indicates the maximum of a distribution",
"rather than the length of the probability mass function (including 0)",
"that it represented previously. To replicate previous behaviour reduce",
"max by 1."
),
.frequency = "regularly",
.frequency_id = "dist_spec_max"
)
## check if parametric or nonparametric
if (length(pmf) > 0 &&
!all(
Expand Down

0 comments on commit 894ce6d

Please sign in to comment.