Skip to content

Commit 5322c50

Browse files
sbfnkjamesmbaazam
andcommitted
857: improve language around the use of dist_spec (#940)
* improve language around the use of dist_spec * add news item * add reviewer / fix typo Co-authored-by: James Azam <james.azam@lshtm.ac.uk> --------- Co-authored-by: James Azam <james.azam@lshtm.ac.uk>
1 parent 748b1e2 commit 5322c50

8 files changed

+16
-9
lines changed

NEWS.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- Brought the docs on `alpha_sd` up to date with the code change from prior PR #853. By @zsusswein in #862 and reviewed by @jamesmbaazam.
3434
- The `...` argument in `estimate_secondary()` has been removed because it was not used. By @jamesmbaazam in #894 and reviewed by @.
3535
- All examples now use the natural parameters of distributions rather than the mean and standard deviation when specifying uncertain distributions. This is to eliminate warnings and encourage best practice. By @jamesmbaazam in #893 and reviewed by @sbfnk.
36+
- The ways that `dist_spec()` with certain/uncertain parameters can be constrained has been clarified. By @sbfnk in #940 and reviewed by @jamesmbaazam.
3637

3738
# EpiNow2 1.6.1
3839

R/checks.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,10 @@ check_stan_delay <- function(dist) {
111111
if (any(is.infinite(max(dist))) && !(attr(dist, "cdf_cutoff") > 0)) {
112112
cli_abort(
113113
c(
114-
"i" = "All distribution passed to the model need to have a
114+
"i" = "All distributions passed to the model need to have a
115115
{col_blue(\"finite maximum\")}, which can be achieved either by
116-
setting {.var max} or non-zero {.var cdf_cutoff}."
116+
setting {.var max} or, if using a distribution with fixed parameters,
117+
non-zero {.var cdf_cutoff}."
117118
)
118119
)
119120
}

R/dist_spec.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,8 @@ plot.dist_spec <- function(x, samples = 50L, res = 1, cumulative = TRUE, ...) {
751751
c(
752752
"!" = "All distributions in {.var x} must have a finite
753753
maximum value.",
754-
"i" = "You can set a finite maximum either as an
755-
argument to {.fn plot} or when defining the distribution."
754+
"i" = "You can set a finite maximum or CDF cutoff
755+
when defining the distribution."
756756
)
757757
)
758758
}

R/opts.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,8 @@ filter_opts <- function(opts, region) {
11991199
#' @param dist A <dist_spec>
12001200
#' @param default_cdf_cutoff Numeric; default CDF cutoff to be used if an
12011201
#' unconstrained distribution is passed as `dist`. If `dist` is already
1202-
#' constrained by having a maximum or CDF cutoff this is ignored.
1202+
#' constrained by having a maximum or CDF cutoff this is ignored. Note that
1203+
#' this can only be done for <dist_spec> objects with fixed parameters.
12031204
#' @param cdf_cutoff_set Logical; whether the default CDF cutoff has been set by
12041205
#' the user; if yes and `dist` is constrained a warning is issued
12051206
#' @importFrom cli cli_inform cli_warn

man/apply_default_cdf_cutoff.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/delay_opts.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/generation_time_opts.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/trunc_opts.Rd

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)