-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
upkeepmaintenance, infrastructure, and similarmaintenance, infrastructure, and similar
Description
As far as I can tell, check_model_exists() and check_model_doesnt_exists() doesn't need to be exported, and isn't being used outside of parsnip
Code:
Lines 126 to 156 in b74e6e4
| #' @rdname set_new_model | |
| #' @export | |
| check_model_exists <- function(model) { | |
| if (rlang::is_missing(model) || length(model) != 1 || !is.character(model)) { | |
| rlang::abort("Please supply a character string for a model name (e.g. `'linear_reg'`)") | |
| } | |
| current <- get_model_env() | |
| if (!any(current$models == model)) { | |
| rlang::abort(glue::glue("Model `{model}` has not been registered.")) | |
| } | |
| invisible(NULL) | |
| } | |
| #' @rdname set_new_model | |
| #' @export | |
| check_model_doesnt_exist <- function(model) { | |
| if (rlang::is_missing(model) || length(model) != 1 || !is.character(model)) { | |
| rlang::abort("Please supply a character string for a model name (e.g. `'linear_reg'`)") | |
| } | |
| current <- get_model_env() | |
| if (any(current$models == model)) { | |
| rlang::abort(glue::glue("Model `{model}` already exists")) | |
| } | |
| invisible(NULL) | |
| } |
Github searches:
https://github.com/search?q=parsnip+check_model_exists&type=code
https://github.com/search?q=parsnip+check_model_doesnt_exist&type=code
Metadata
Metadata
Assignees
Labels
upkeepmaintenance, infrastructure, and similarmaintenance, infrastructure, and similar