parameters.list() has an inline check that rejects non-param objects before parameters_constr() is called.
|
elem_param <- purrr::map_lgl(x, inherits, "param") |
|
if (!all(elem_param)) { |
|
cli::cli_abort("The objects should all be {.cls param} objects.") |
|
} |
This means check_list_of_param()'s NA-allowing behavior is never exercised from the parameters.list() and parameters.param() paths.
|
is_good_boi <- map_lgl(x, param_or_na) |
Thus, can we remove that NA-allowing behaviour? We do use the constructor directly in other tidymodels packages in extract_parameter_set_dials() methods: https://github.com/search?q=org%3Atidymodels%20parameters_constr&type=code
parameters.list()has an inline check that rejects non-param objects beforeparameters_constr()is called.dials/R/parameters.R
Lines 47 to 50 in 44ba2aa
This means
check_list_of_param()'s NA-allowing behavior is never exercised from theparameters.list()andparameters.param()paths.dials/R/parameters.R
Line 81 in 44ba2aa
Thus, can we remove that NA-allowing behaviour? We do use the constructor directly in other tidymodels packages in
extract_parameter_set_dials()methods: https://github.com/search?q=org%3Atidymodels%20parameters_constr&type=code