Skip to content

857: improve language around the use of dist_spec #940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
improve language around the use of dist_spec
  • Loading branch information
sbfnk committed Jan 30, 2025
commit 9216e568195039862caa086f83eb160c9d10de2c
5 changes: 3 additions & 2 deletions R/checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ check_stan_delay <- function(dist) {
if (any(is.infinite(max(dist))) && !(attr(dist, "cdf_cutoff") > 0)) {
cli_abort(
c(
"i" = "All distribution passed to the model need to have a
"i" = "All distributions passed to the model need to have a
{col_blue(\"finite maximum\")}, which can be achieved either by
setting {.var max} or non-zero {.var cdf_cutoff}."
setting {.var max} or, if using a distribution with fixed parameters,
non-zero {.var cdf_cutoff}."
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions R/dist_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ plot.dist_spec <- function(x, samples = 50L, res = 1, cumulative = TRUE, ...) {
c(
"!" = "All distributions in {.var x} must have a finite
maximum value.",
"i" = "You can set a finite maximum either as an
argument to {.fn plot} or when defining the distribution."
"i" = "You can set a finite maximum or CDF cutoff
when defining the distribution."
)
)
}
Expand Down
3 changes: 2 additions & 1 deletion R/opts.R
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,8 @@ filter_opts <- function(opts, region) {
#' @param dist A <dist_spec>
#' @param default_cdf_cutoff Numeric; default CDF cutoff to be used if an
#' unconstrained distribution is passed as `dist`. If `dist` is already
#' constrained by having a maximum or CDF cutoff this is ignored.
#' constrained by having a maximum or CDF cutoff this is ignored. Note that
#' this can only be done for <dist_spec> objects with fixed parameters.
#' @param cdf_cutoff_set Logical; whether the default CDF cutoff has been set by
#' the user; if yes and `dist` is constrained a warning is issued
#' @importFrom cli cli_inform cli_warn
Expand Down
3 changes: 2 additions & 1 deletion man/apply_default_cdf_cutoff.Rd

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

3 changes: 2 additions & 1 deletion man/delay_opts.Rd

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

3 changes: 2 additions & 1 deletion man/generation_time_opts.Rd

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

3 changes: 2 additions & 1 deletion man/trunc_opts.Rd

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