-
Notifications
You must be signed in to change notification settings - Fork 106
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
Refactor printing of steps #871
Conversation
This should be all the changes here in {recipes} to the steps. I tried to minimally change the the output. Many more steps now correctly print "" when no variables are selected |
Finished running revdepcheck Results:
The new warning is: which doesn't have anything to do with this PR
|
* changes for #823 * use kernlab directly instead if dimRed * use fastICA directly instead of dimRed * copious skips * add seed argument for ICA and some code refactoring * Update R/misc.R Co-authored-by: Davis Vaughan <davis@rstudio.com> * uncomment example code * rename calling function * small new change * roll back kpca change (bad update form main) * updated print method for #871 * changes based on reviewer feedback Co-authored-by: Davis Vaughan <davis@rstudio.com>
This pull request 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. |
Problem
We want to move over to using {cli} for printing in the package #426. However the current way printing is done in this package + extension packages doesn't allow for an easy transition. {cli} and
cat()
doesn't work well together. The reprex below neatly outlines the problem with trying to move to {cli} using extension packages.Suppose that we completely swap to {cli} but the user uses an older version of an extension package. Then when an extension step is being used it will contain a
cat()
call, messing with the print method. (SMOTE based on
is being printed before everything else`)Created on 2021-12-15 by the reprex package (v2.0.1)
Solution / Plan
My proposed solution is to move to {cli} over two releases.
version 0.1.18
print_step()
function, supersedingprinter()
. This function will keep printing output unchanged, but moves the responsibility of step title printing.print_step()
in favor ofprinter()
whenever possible. With the goal of eliminating all calls tocat()
fromprint.step_*()
functions across all packages.version 0.1.19
print.recipe()
andprint_step()
move fromcat()
to {cli}.This is not a perfect solution, but it reduces the change someone gets butchered printing from recipes as they would need to have version 0.1.19 recipes, but a pre 0.1.18 extension package.