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

fix: print_step not using width parameter #1263

Closed
wants to merge 1 commit into from
Closed

Conversation

atusy
Copy link

@atusy atusy commented Nov 17, 2023

Althou variety of print.step_*() passes its own width to print_step(), print_step() is not using it.

This PR fixes the problem.

Example of widths defined by print.step_*() are below

recipes/R/dummy.R

Lines 313 to 314 in 17211e6

print.step_dummy <-
function(x, width = max(20, options()$width - 20), ...) {

recipes/R/inverse.R

Lines 110 to 111 in 17211e6

print.step_inverse <-
function(x, width = max(20, options()$width - 33), ...) {

@EmilHvitfeldt
Copy link
Member

Hello @atusy! Thanks for looking into this, unfortunately this isn't an issue. The code is written the way it is because the old way of printing the steps with printer()

recipes/R/misc.R

Lines 299 to 302 in 6bc9cb0

printer <- function(tr_obj = NULL,
untr_obj = NULL,
trained = FALSE,
width = max(20, options()$width - 30)) {

used to use width as a way to figure out how wide to print. It wasn't working that well and it is now no longer needed as print_step() is able to calculate everything it needs itself.

The arguments are still there to avoid breaking stuff as we moved over the change

Copy link

github-actions bot commented Dec 2, 2023

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.

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

Successfully merging this pull request may close these issues.

2 participants