Skip to content

Don't allow inclusive = c(FALSE, FALSE) for integer parameters with a range of 2 consecutive values #373

Closed
@hfrick

Description

@hfrick

Follow-up to #347

This should not be possible since there are no integer values left if the range is 0 to 1 and exclusive of the borders. We should require inclusive = c(TRUE, TRUE) since setting one border to exclusive still only leave a single value which is not useful for tuning.

library(dials)
#> Loading required package: scales

# this should not be possible
int_non_incl <- new_quant_param(
  type = "integer",
  range = c(0, 1),
  inclusive = c(FALSE, FALSE),
  trans = NULL,
  label = c(param_non_incl = "some label"),
  finalize = NULL
)
# because it enables this
value_sample(int_non_incl, n = 3)
#> [1] 0 0 0
value_seq(int_non_incl, n = 3)
#> [1] 0 1

Created on 2025-01-30 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions