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

revisit why print.workflow() re-implements print methods for its stages #236

Open
simonpcouch opened this issue May 31, 2024 · 1 comment
Labels
feature a feature request or enhancement

Comments

@simonpcouch
Copy link
Contributor

workflows rewrites print methods for each of its stage for printing. We should revisit why this is the case, and either 1) document in a code comment why it is that we're rewriting those methods, or 2) re-implement the postprocessor printing in print.workflow()

workflows/R/workflow.R

Lines 473 to 479 in 9e6ca98

# TODO: currently this function just captures and reprints the tailor
# print method. other workflows methods define their own print methods;
# considering doing so or refactoring.
# TODO: this snap currently includes some NA return values and marks the
# following output as a message rather than output.
tailor_print <- utils::capture.output(tailor, type = "message")
cat_line(tailor_print[3:length(tailor_print)])

Notably, the oddity with tailor printing's output currently is that, when in a trained workflow, both the workflow and its postprocessor stage have a tag marking themselves as "[trained]".

@simonpcouch
Copy link
Contributor Author

After following up with others on this, it's indeed surprising to others that workflows doesn't just rely on recipes and parsnip for print methods (and possibly modifying them a bit before passing on). Since this is how we've implememented postprocessor printing, I'll remove it from the board but keep the issue open to remind us to do so for parsnip and recipes at some point.

@EmilHvitfeldt EmilHvitfeldt added the feature a feature request or enhancement label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants