Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove homegrown deprecation functions #323

Closed
EmilHvitfeldt opened this issue Oct 4, 2022 · 3 comments · Fixed by #359
Closed

Remove homegrown deprecation functions #323

EmilHvitfeldt opened this issue Oct 4, 2022 · 3 comments · Fixed by #359
Labels
upkeep maintenance, infrastructure, and similar

Comments

@EmilHvitfeldt
Copy link
Member

EmilHvitfeldt commented Oct 4, 2022

I'm also going to open an issue for us to remove our home-grown deprecation functions.

Originally posted by @DavisVaughan in #322 (comment)

@EmilHvitfeldt EmilHvitfeldt added the upkeep maintenance, infrastructure, and similar label Oct 4, 2022
@DavisVaughan
Copy link
Member

I think this can probably replace warn_event_first_deprecated()

lifecycle::deprecate_warn(
  when = "0.0.7",
  what = I("The global option `yardstick.event_first`"),
  with = I("the metric function argument `event_level`"),
  details = "The global option is being ignored entirely."
)

At this point I hope most people have moved off this global option, so I think we can just stop supporting it in the next minor version of yardstick as mentioned here #173 (comment)

@DavisVaughan
Copy link
Member

For the roc-curve one you can probably use the standard lifecycle syntax of what = "roc_curve(options =)" with an additional line for details (and you will need to handle the what argument)

warn_roc_options_deprecated <- function(what) {
message <- c(
sprintf("The `options` argument of `%s()` is deprecated as of yardstick 1.0.0.", what),
"This argument no longer has any effect, and is being ignored.",
"Use the pROC package directly if you need these features."
)
message <- paste0(message, collapse = "\n")
warn_deprecated(message)
}

And for conf_mat() the syntax looks like what = "conf_mat(...)"

yardstick/R/conf_mat.R

Lines 209 to 217 in 1323a73

warn_conf_mat_dots_deprecated <- function() {
message <- c(
"The `...` argument of `conf_mat()` is deprecated as of yardstick 1.0.0.",
"This argument no longer has any effect, and is being ignored."
)
message <- paste0(message, collapse = "\n")
warn_deprecated(message)
}

Both of those can also use deprecate_warn() I think.

Then you can nuke this file https://github.com/tidymodels/yardstick/blob/main/R/compat-lifecycle.R

@github-actions
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants