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

Update to use print_step() instead of printer() in print methods #80

Closed
EmilHvitfeldt opened this issue Feb 22, 2022 · 1 comment · Fixed by #81
Closed

Update to use print_step() instead of printer() in print methods #80

EmilHvitfeldt opened this issue Feb 22, 2022 · 1 comment · Fixed by #81
Labels
Upkeep maintenance, infrastructure, and similar

Comments

@EmilHvitfeldt
Copy link
Member

Hello 👋

In the most recent CRAN release of {recipes}, we took the first step towards updating the printing infrastructure to use {cli}. This means that in order for your steps to print properly when the next version of {recipes} gets on CRAN, you will need to have adopted this change as well. Failure to do so won't result in errors, only malformed printing. The change itself is fairly minimal. Please see the following PR tidymodels/recipes#871 for examples of how this change is to be done. Please let me know if you have any questions!

See example below:

# Old
print.step_pls <- function(x, width = max(20, options()$width - 35), ...) {
  cat("PLS feature extraction with ")
  printer(x$columns, x$terms, x$trained, width = width)
  invisible(x)
}

# New
print.step_pls <- function(x, width = max(20, options()$width - 35), ...) {
  title <- "PLS feature extraction with "
  print_step(x$columns, x$terms, x$trained, width = width, title = title)
  invisible(x)
}
@EmilHvitfeldt EmilHvitfeldt added the Upkeep maintenance, infrastructure, and similar label Feb 22, 2022
@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 Mar 12, 2022
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.

1 participant