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

Print environment contents when loading it. #133

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Print environment contents when loading it. #133

merged 1 commit into from
Jul 3, 2024

Conversation

plietar
Copy link
Member

@plietar plietar commented Jun 28, 2024

hipercow silently attaches packages and sources files from the configured environment. If something goes wrong in this process (eg. the file does not exist), it can be difficult for users to understand what is happening. None of their own code makes any mention of the files or packages in question, and they may have forgotten that they ever created the environment.

This prints a message when loading the environment, with the list of files and packages that will be loaded. This should provide enough hints for the user to make the connection between a hypothetical error and the environment.

hipercow silently attaches packages and sources files from the
configured environment. If something goes wrong in this process (eg. the
file does not exist), it can be difficult for users to understand what
is happening. None of their own code makes any mention of the files or
packages in question, and they may have forgotten that they ever created
the environment.

This prints a message when loading the environment, with the list of
files and packages that will be loaded. This should provide enough hints
for the user to make the connection between a hypothetical error and the
environment.
@@ -38,7 +38,7 @@ task_eval <- function(id, envir = .GlobalEnv, verbose = FALSE, root = NULL) {
version <- utils::packageVersion("hipercow")
cli::cli_h1("hipercow {version} running at '{root$path$root}'")
cli::cli_alert_info("library paths:")
cli::cli_li(.libPaths())
cli::cli_ul(.libPaths())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cli_li was leaving a container open, which then indented all other bullet points in the function.
cli_ul does not have this problem, as it closes the container when given a non-NULL argument.

@plietar plietar requested a review from weshinsley July 1, 2024 09:40
Copy link
Contributor

@weshinsley weshinsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@weshinsley weshinsley merged commit c1f77ab into main Jul 3, 2024
14 checks passed
@plietar plietar deleted the mrc-5489 branch July 3, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants