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

Use rlang::check_installed() on checking the dependencies #526

Closed
yutannihilation opened this issue Jul 8, 2021 · 6 comments
Closed

Use rlang::check_installed() on checking the dependencies #526

yutannihilation opened this issue Jul 8, 2021 · 6 comments
Labels
feature a feature request or enhancement

Comments

@yutannihilation
Copy link

Currently parsnip:::check_installs() just aborts when the dependency package is not installed yet. I think it would be helpful to use rlang::check_install() to let users install the packages interactively.

> rlang::check_installed(c("foo", "bar"))
ℹ The `foo` and `bar` packages are required.
x Would you like to install them?

1: Yes
2: No

Selection:
@hfrick hfrick added the feature a feature request or enhancement label Jul 8, 2021
@topepo
Copy link
Member

topepo commented Jul 8, 2021

I think that it is better to leave as-is. If someone is using parallel processing during and interactive session, we don't want the worker processes trying to prompt the user for input.

If you want, you could create a check_package_dependency() function that will do the interactive bits outside of the tuning or resampling processes.

@yutannihilation
Copy link
Author

Ah, I didn't consider parallelism, sorry...

@topepo
Copy link
Member

topepo commented Jul 8, 2021

No worries. It is was a good idea.

@juliasilge
Copy link
Member

We could consider adding an additional "precheck" check before fitting happens (possibly in workers) to see if packages are installed in the main R process. This "precheck" (using rlang::check_installed() would probably be helpful and involve less friction for the majority of R users.

@simonpcouch
Copy link
Contributor

In light of the above discussion, and for consistency with tune:::check_installs(), we'll continue to fail here. As long as we continue to fail early, I think this is indeed the right way to go.

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 Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants