Skip to content

Stop allowing NA in parameter sets? #432

Description

@hfrick

parameters.list() has an inline check that rejects non-param objects before parameters_constr() is called.

dials/R/parameters.R

Lines 47 to 50 in 44ba2aa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions